Opened 13 months ago

Last modified 13 months ago

#67995 new defect

Erlang 26.0 (default) is not supported by Rabbitmq 3.11.15 (default), Erlang 25.3 is needed.

Reported by: ed1507 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: rabbitmq erlang Cc:
Port: rabbitmq-server

Description (last modified by ed1507)

Erlang 26.0 (current and unique version supported in Macports) is not supported by Rabbitmq-server 3.11.15 (current and unique version supported in Macports), Erlang 25.3 is needed to get a functional and usable Rabbitmq-server. Otherwise, in my case I am getting connection reset problems.

It is pointed out in the Rabbitmq official documentation here:

https://www.rabbitmq.com/which-erlang.html

The same problem is reported in StackOverflow here:

https://stackoverflow.com/questions/76274566/rabbitmq-closed-connection-on-method-createmodel

And , as I said, I am having connections reset turning my rabbitmq-service instalation unusable despite the fact it get installed and start without problems.

Thanks.

Change History (3)

comment:1 Changed 13 months ago by ed1507

Description: modified (diff)

comment:2 Changed 13 months ago by knightcode (Dylan)

I also seem to be affected by this

comment:3 Changed 13 months ago by ed1507

I worked around a solution by take the approach documented in ​ https://guide.macports.org/#development.local-repositories and leave Rabbitmq 3.11.15 and better adopt the 3.12.4 and preserve Erlang 26.0

Please be aware this info contains hash-codes and URLs used for download code. Please verify the information is current and updated in order to avoid compromise the security of your system. Take it by your own risk. This example is intended as reference because it works for me. Actually you can compare it with the actual code in MacPorts git repository to identify what the actual changes are https://github.com/macports/macports-ports/tree/master/net/rabbitmq-server

%find . #in a local directory used as local repository
./net
./net/rabbitmq-server
./net/rabbitmq-server/Portfile
./net/rabbitmq-server/files
./net/rabbitmq-server/files/rabbitmq-script-wrapper

%cat ./net/rabbitmq-server/Portfile 
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           github 1.0

github.setup        rabbitmq rabbitmq-server 3.12.4 v
revision            0
checksums           rmd160  0a6b504916759efcdd39b8f03cedd4a1f50d6a58 \
                    sha256  03bc521e664afd8278d40193bb6fbe3d66d6301fc24cbb120bf53fda6613ef36 \
                    size    15639796

categories          net
platforms           {darwin any}
maintainers         nomaintainer
license             MPL-1.1 MIT Apache-2
supported_archs     noarch

description         The RabbitMQ AMQP Server
long_description    \
    RabbitMQ is an implementation of AMQP, the emerging standard for \
    high performance enterprise messaging. The RabbitMQ server is a \
    robust and scalable implementation of an AMQP broker.

homepage            https://www.rabbitmq.com
github.tarball_from releases
use_xz              yes
distfiles           ${name}-generic-unix-${version}${extract.suffix}
worksrcdir          [string map {- _} $name]-$version

depends_lib         port:erlang
depends_build       port:libxslt

if {${os.platform} eq "darwin" && ${os.major} <= 9} {
    depends_build-append port:py27-simplejson
    build.args      PYTHON=${prefix}/bin/python2.7
} else {
    # python3.X doesn't work
    build.args      PYTHON=python2.7
}

set serveruser      rabbitmq
set servergroup     rabbitmq
set serverhome      ${prefix}/var/lib/rabbitmq
set logdir          ${prefix}/var/log/rabbitmq
set confdir         ${prefix}/etc/rabbitmq
set mnesiadbdir     ${prefix}/var/lib/rabbitmq/mnesia
set plistloc        ${prefix}/etc/LaunchDaemons/org.macports.${name}
set rootdest        ${prefix}/lib/rabbitmq
set rootserver      ${rootdest}/lib/${worksrcdir}
set sbindir         ${destroot}${rootdest}/bin
set wrappersbin     ${destroot}${prefix}/sbin
set realsbin        ${destroot}${rootserver}/sbin
set mansrc          ${workpath}/${worksrcdir}/share/man
set mandest         ${destroot}${prefix}/share/man

add_users ${serveruser} group=${servergroup} realname=RabbitMQ\ Server home=${serverhome}

use_configure       no

build {}

destroot.keepdirs \
    ${destroot}${confdir} \
    ${destroot}${logdir} \
    ${destroot}${mnesiadbdir}

destroot {
    # This is a hack: We need to patch the startupitem, so generate it manually
    # here, then define the function to empty to avoid overwriting it later
    package require portstartupitem 1.0
    portstartupitem::startupitem_create
    proc portstartupitem::startupitem_create {args} {}
    system -W "${destroot}${plistloc}" "/usr/libexec/PlistBuddy -c \"Add :UserName string ${serveruser}\" org.macports.${name}.plist"

    xinstall -d -m 0775 ${destroot}${confdir}
    xinstall -d -g [existsgroup ${servergroup}] -m 0775 ${destroot}${logdir}
    xinstall -d -g [existsgroup ${servergroup}] -m 0775 ${destroot}${serverhome}
    xinstall -d -g [existsgroup ${servergroup}] -m 0775 ${destroot}${mnesiadbdir}
    xinstall -d -g [existsgroup ${servergroup}] -m 0775 ${destroot}${rootserver}
    xinstall -d -g [existsgroup ${servergroup}] -m 0775 ${destroot}
    xinstall -d -g [existsgroup ${servergroup}] -m 0775 ${sbindir}

    copy {*}[glob ${worksrcpath}/*] ${destroot}${rootserver}/

    reinplace -E "s:^SYS_PREFIX=\\\${RABBITMQ_HOME}$:SYS_PREFIX=${prefix}:" \
        ${realsbin}/rabbitmq-defaults

    xinstall -m 0755 ${filespath}/rabbitmq-script-wrapper \
                ${wrappersbin}/rabbitmq-server
    reinplace -E "s:@MACPORTS_PREFIX@:${prefix}:g" \
                ${wrappersbin}/rabbitmq-server
    reinplace -E "s:/usr/lib/rabbitmq/bin/:${prefix}/lib/rabbitmq/bin/:g" \
                ${wrappersbin}/rabbitmq-server
    reinplace -E "s:/var/lib/rabbitmq:${prefix}/var/lib/rabbitmq:g" \
                ${wrappersbin}/rabbitmq-server

    copy ${wrappersbin}/rabbitmq-server ${wrappersbin}/rabbitmqctl
    copy ${wrappersbin}/rabbitmq-server ${wrappersbin}/rabbitmq-plugins
    file attributes ${destroot}${serverhome} -owner ${serveruser} -group ${servergroup}
    file attributes ${destroot}${logdir} -owner ${serveruser} -group ${servergroup}

    foreach script {rabbitmq-defaults rabbitmq-env rabbitmq-plugins rabbitmq-server rabbitmqctl cuttlefish} {
        ln -s ../lib/${worksrcdir}/sbin/${script} ${sbindir}/${script}
    }

    xinstall -m 0644 -W ${mansrc}/man8 rabbitmq-plugins.8.gz \
        rabbitmq-server.8.gz rabbitmqctl.8.gz ${mandest}/man8/
    xinstall -m 0644 -W ${mansrc}/man5 rabbitmq-env.conf.5.gz ${mandest}/man5/
}

startupitem.create  yes
startupitem.init    "PATH=${prefix}/bin:${prefix}/sbin:\$PATH; export PATH"
startupitem.start   "rabbitmq-server 2>&1"
startupitem.stop    "rabbitmqctl stop 2>&1"
startupitem.logfile ${prefix}/var/log/rabbitmq/startupitem.log

github.livecheck.regex  {([0-9.]+)}

master_sites      https://github.com/rabbitmq/rabbitmq-server/releases

version           3.12.4

%cat ./net/rabbitmq-server/files/rabbitmq-script-wrapper 
#!/bin/sh
##  The contents of this file are subject to the Mozilla Public License
##  Version 1.1 (the "License"); you may not use this file except in
##  compliance with the License. You may obtain a copy of the License
##  at http://www.mozilla.org/MPL/
##
##  Software distributed under the License is distributed on an "AS IS"
##  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
##  the License for the specific language governing rights and
##  limitations under the License.
##
##  The Original Code is RabbitMQ.
##
##  The Initial Developer of the Original Code is VMware, Inc.
##  Copyright (c) 2007-2012 VMware, Inc.  All rights reserved.
##

# Escape spaces and quotes, because shell is revolting.
for arg in "$@" ; do
	# Escape quotes in parameters, so that they're passed through cleanly.
	arg=$(sed -e 's/"/\\"/g' <<-END
		$arg
		END
	)
	CMDLINE="${CMDLINE} \"${arg}\""
done

cd /var/lib/rabbitmq

SCRIPT=`basename $0`

if [ `id -u` = `id -u rabbitmq` -a "$SCRIPT" = "rabbitmq-server" ] ; then
    /usr/lib/rabbitmq/bin/rabbitmq-server "$@" @STDOUT_STDERR_REDIRECTION@
elif [ `id -u` = `id -u rabbitmq` -o "$SCRIPT" = "rabbitmq-plugins" ] ; then
    /usr/lib/rabbitmq/bin/${SCRIPT} "$@"
elif [ `id -u` = 0 ] ; then
    SHELL=/bin/sh HOME=/var/lib/rabbitmq USER=rabbitmq LOGNAME=rabbitmq PATH="$(eval `PATH=@MACPORTS_PREFIX@/bin /usr/libexec/path_helper -s`; echo $PATH)" su -m rabbitmq -c "/usr/lib/rabbitmq/bin/${SCRIPT} ${CMDLINE}"
else
    /usr/lib/rabbitmq/bin/${SCRIPT}
    echo
    echo "Only root or rabbitmq should run ${SCRIPT}"
    echo
    exit 1
fi


Last edited 13 months ago by ed1507 (previous) (diff)
Note: See TracTickets for help on using tickets.