X2Go Bug report logs - #1013
x2gobroker-daemon doesn't return error when it can't spawn/bind to port

version graph

Package: x2gobroker-daemon; Maintainer for x2gobroker-daemon is X2Go Developers <x2go-dev@lists.x2go.org>; Source for x2gobroker-daemon is src:x2gobroker.

Reported by: Stefan Baur <X2Go-ML-1@baur-itcs.de>

Date: Tue, 22 Mar 2016 09:55:02 UTC

Severity: minor

Tags: pending

Found in version 0.0.3.0

Fixed in version 0.0.4.0

Done: X2Go Release Manager X2Go Release Manager <git-admin@x2go.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to x2go-dev@lists.x2go.org, X2Go Developers <x2go-dev@lists.x2go.org>:
Bug#1013; Package x2gobroker-daemon. (Tue, 22 Mar 2016 09:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Baur <X2Go-ML-1@baur-itcs.de>:
New Bug report received and forwarded. Copy sent to X2Go Developers <x2go-dev@lists.x2go.org>. (Tue, 22 Mar 2016 09:55:02 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.x2go.org (full text, mbox):

From: Stefan Baur <X2Go-ML-1@baur-itcs.de>
To: submit@bugs.x2go.org
Subject: x2gobroker-daemon doesn't return error when it can't spawn/bind to port
Date: Tue, 22 Mar 2016 10:54:43 +0100
[Message part 1 (text/plain, inline)]
package: x2gobroker-daemon
version: 0.0.3.0


This is what happened:

node:~# service x2gobroker-daemon stop
[....] Stopping X2Go Session Broker standalone daemon:
x2gobroker-daemonstart-stop-daemon: warning: failed to kill 14170: No
such process
 failed!
# huh, wait, what?
node:~# ps ax | grep brok
 5499 ?        S      0:00 x2gobroker-authservice -s
/run/x2gobroker/x2gobroker-authservice.socket -o root -g x2gobroker -p 0660
18791 pts/0    S+     0:00 grep brok
# no running x2gobroker-daemon, so ...

# let's remove the PID file:
node:~# rm /run/x2gobroker/x2gobroker-daemon.pid

node:~# service x2gobroker-daemon stop
node:~# service x2gobroker-daemon start
[ ok ] Starting X2Go Session Broker standalone daemon: x2gobroker-daemon.
# looking good so far ...

node:~# service x2gobroker-daemon stop
[....] Stopping X2Go Session Broker standalone daemon:
x2gobroker-daemonstart-stop-daemon: warning: failed to kill 18470: No
such process
 failed!
# whoops, again?

node:~# ps ax | grep brok
 5499 ?        S      0:00 x2gobroker-authservice -s
/run/x2gobroker/x2gobroker-authservice.socket -o root -g x2gobroker -p 0660
18791 pts/0    S+     0:00 grep brok
# no running x2gobroker-daemon, so ...

# let's remove the PID file:
node:~# rm /run/x2gobroker/x2gobroker-daemon.pid

# I wonder what a restart will do?
node:~# service x2gobroker-daemon restart
[ ok ] Starting X2Go Session Broker standalone daemon: x2gobroker-daemon.
node:~# service x2gobroker-daemon restart
[....] Stopping X2Go Session Broker standalone daemon:
x2gobroker-daemonstart-stop-daemon: warning: failed to kill 18641: No
such process
 failed!
[warn] X2Go Session Broker: stale PID file
(/run/x2gobroker/x2gobroker-daemon.pid). Delete it manually! ... (warning).
node:~# ps ax | grep brok
 5499 ?        S      0:00 x2gobroker-authservice -s
/run/x2gobroker/x2gobroker-authservice.socket -o root -g x2gobroker -p 0660
18791 pts/0    S+     0:00 grep brok
# and again, no running x2gobroker-daemon :-(


The reason, as I found out later, was, that it tries to bind to
127.0.0.1:8080 by default, and that port is already in use by another
process on that machine.

IMO, this is a bug: when it can't bind to the port, and thus dies, this
should be returned to the start script, so it can report back "FAILED".

-Stefan

-- 
BAUR-ITCS UG (haftungsbeschränkt)
Geschäftsführer: Stefan Baur
Eichenäckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364
Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to x2go-dev@lists.x2go.org, X2Go Developers <x2go-dev@lists.x2go.org>:
Bug#1013; Package x2gobroker-daemon. (Tue, 22 Mar 2016 11:05:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
Extra info received and forwarded to list. Copy sent to X2Go Developers <x2go-dev@lists.x2go.org>. (Tue, 22 Mar 2016 11:05:01 GMT) Full text and rfc822 format available.

Message #10 received at 1013@bugs.x2go.org (full text, mbox):

From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: Stefan Baur <X2Go-ML-1@baur-itcs.de>, 1013@bugs.x2go.org
Subject: Re: [X2Go-Dev] Bug#1013: x2gobroker-daemon doesn't return error when it can't spawn/bind to port
Date: Tue, 22 Mar 2016 11:01:34 +0000
[Message part 1 (text/plain, inline)]
Control: severity -1 minor

HI Stefan,

On  Di 22 Mär 2016 10:54:43 CET, Stefan Baur wrote:

> The reason, as I found out later, was, that it tries to bind to
> 127.0.0.1:8080 by default, and that port is already in use by another
> process on that machine.
>
> IMO, this is a bug: when it can't bind to the port, and thus dies, this
> should be returned to the start script, so it can report back "FAILED".

Yeah, this is a valid issue. Is you system launching x2gobroker-daemon  
via systemd or via System V init scripts?

Mike
-- 

DAS-NETZWERKTEAM
mike gabriel, herweg 7, 24357 fleckeby
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: mike.gabriel@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/mailxchange/kronolith/fb.php?u=m.gabriel%40das-netzwerkteam.de
[Message part 2 (application/pgp-signature, inline)]

Severity set to 'minor' from 'normal' Request was from Mike Gabriel <mike.gabriel@das-netzwerkteam.de> to 1013-submit@bugs.x2go.org. (Tue, 22 Mar 2016 11:05:02 GMT) Full text and rfc822 format available.

Information forwarded to x2go-dev@lists.x2go.org, X2Go Developers <x2go-dev@lists.x2go.org>:
Bug#1013; Package x2gobroker-daemon. (Tue, 22 Mar 2016 11:10:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Baur <X2Go-ML-1@baur-itcs.de>:
Extra info received and forwarded to list. Copy sent to X2Go Developers <x2go-dev@lists.x2go.org>. (Tue, 22 Mar 2016 11:10:03 GMT) Full text and rfc822 format available.

Message #17 received at 1013@bugs.x2go.org (full text, mbox):

From: Stefan Baur <X2Go-ML-1@baur-itcs.de>
To: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>, 1013@bugs.x2go.org
Subject: Re: [X2Go-Dev] Bug#1013: x2gobroker-daemon doesn't return error when it can't spawn/bind to port
Date: Tue, 22 Mar 2016 12:03:52 +0100
[Message part 1 (text/plain, inline)]
Am 22.03.2016 um 12:01 schrieb Mike Gabriel:
> 
> Yeah, this is a valid issue. Is you system launching x2gobroker-daemon
> via systemd or via System V init scripts?

This is on System V init, as we've seen SystemD misbehaving with some of
our own init scripts.

Kind Regards,
Stefan

-- 
BAUR-ITCS UG (haftungsbeschränkt)
Geschäftsführer: Stefan Baur
Eichenäckerweg 10, 89081 Ulm | Registergericht Ulm, HRB 724364
Fon/Fax 0731 40 34 66-36/-35 | USt-IdNr.: DE268653243

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to x2go-dev@lists.x2go.org, X2Go Developers <x2go-dev@lists.x2go.org>:
Bug#1013; Package x2gobroker-daemon. (Thu, 13 Sep 2018 13:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mike Gabriel <mike.gabriel@das-netzwerkteam.de>:
Extra info received and forwarded to list. Copy sent to X2Go Developers <x2go-dev@lists.x2go.org>. (Thu, 13 Sep 2018 13:30:02 GMT) Full text and rfc822 format available.

Message #22 received at 1013@bugs.x2go.org (full text, mbox):

From: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
To: 1013-submitter@bugs.x2go.org
Cc: control@bugs.x2go.org, 1013@bugs.x2go.org
Subject: X2Go issue (in src:x2gobroker) has been marked as pending for release
Date: Thu, 13 Sep 2018 15:26:35 +0200 (CEST)
tag #1013 pending
fixed #1013 0.0.4.0
thanks

Hello,

X2Go issue #1013 (src:x2gobroker) reported by you has been
fixed in X2Go Git. You can see the changelog below, and you can
check the diff of the fix at:

    http://code.x2go.org/gitweb?p=x2gobroker.git;a=commitdiff;h=c3067f0

The issue will most likely be fixed in src:x2gobroker (0.0.4.0).

light+love
X2Go Git Admin (on behalf of the sender of this mail)

---
commit c3067f00df60d43ebbbecf5dd6f0f8da3c4221e4
Author: Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
Date:   Thu Sep 13 15:26:01 2018 +0200

    bin/x2gobroker: If binding the http server fails, a non-zero exit code should be returned. (Fixes: #1013).

diff --git a/debian/changelog b/debian/changelog
index fc33189..7217c4f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -75,6 +75,8 @@ x2gobroker (0.0.4.0-0x2go1) UNRELEASED; urgency=medium
       install into x2gobroker bin:pkg (on DEB based systems).
     - Makefile.docupload: Add apidoc target (running sphinx-apidoc).
     - docs/source: Initialize Sphinx API documentation's .rst files.
+    - bin/x2gobroker: If binding the http server fails, a non-zero exit code
+      should be returned. (Fixes: #1013).
   * debian/*:
     + Trigger Makefile's install target and install those files. Drop debhelper
       from-source-installation magic.


Added tag(s) pending. Request was from Mike Gabriel <mike.gabriel@das-netzwerkteam.de> to control@bugs.x2go.org. (Thu, 13 Sep 2018 13:30:03 GMT) Full text and rfc822 format available.

Marked as fixed in versions 0.0.4.0. Request was from Mike Gabriel <mike.gabriel@das-netzwerkteam.de> to control@bugs.x2go.org. (Thu, 13 Sep 2018 13:30:04 GMT) Full text and rfc822 format available.

Message sent on to Stefan Baur <X2Go-ML-1@baur-itcs.de>:
Bug#1013. (Thu, 13 Sep 2018 13:30:04 GMT) Full text and rfc822 format available.

Information forwarded to x2go-dev@lists.x2go.org, X2Go Developers <x2go-dev@lists.x2go.org>:
Bug#1013; Package x2gobroker-daemon. (Sat, 02 Feb 2019 21:10:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to X2Go Release Manager X2Go Release Manager <git-admin@x2go.org>:
Extra info received and forwarded to list. Copy sent to X2Go Developers <x2go-dev@lists.x2go.org>. (Sat, 02 Feb 2019 21:10:05 GMT) Full text and rfc822 format available.

Message #34 received at 1013@bugs.x2go.org (full text, mbox):

From: X2Go Release Manager X2Go Release Manager <git-admin@x2go.org>
To: 1013-submitter@bugs.x2go.org
Cc: control@bugs.x2go.org, 1013@bugs.x2go.org
Subject: X2Go issue (in src:x2gobroker) has been marked as closed
Date: Sat, 2 Feb 2019 22:08:25 +0100 (CET)
close #1013
thanks

Hello,

we are very hopeful that X2Go issue #1013 reported by you
has been resolved in the new release (0.0.4.0) of the
X2Go source project »src:x2gobroker«.

You can view the complete changelog entry of src:x2gobroker (0.0.4.0)
below, and you can use the following link to view all the code changes
between this and the last release of src:x2gobroker.

    http://code.x2go.org/gitweb?p=x2gobroker.git;a=commitdiff;h=a2455880e34e31546054ce50abd1512c61430b51;hp=dbea0c7c20c58e6783ea796691f0881131ad6590

If you feel that the issue has not been resolved satisfyingly, feel
free to reopen this bug report or submit a follow-up report with
further observations described based on the new released version
of src:x2gobroker.

Thanks a lot for contributing to X2Go!!!

light+love
X2Go Git Admin (on behalf of the sender of this mail)

---
X2Go Component: src:x2gobroker
Version: 0.0.4.0-0x2go1
Status: RELEASE
Date: Sat, 02 Feb 2019 21:50:29 +0100
Fixes: 1013 1234 1240 1252 1315
Changes:
 x2gobroker (0.0.4.0-0x2go1) RELEASED; urgency=medium
 .
   [ Mike Gabriel ]
   * New upstream version (0.0.4.0):
     - Bump upstream version to 0.0.4.0.
     - Port to Python 3. (Fixes: #1240).
     - Drop left-over debug print() call.
     - Makefile: Assure that setup.py is run under Python3.
     - Improve debugging messages during authentication phase.
     - x2gobroker/basicauth.py: Fix call of base64.decodestring on Python3.
     - Unit tests: Fix deep misunderstanding in the way allow-deny vs.
       deny-allow should actually work.
     - x2gobroker/brokers/base_broker.py: Entire rewrite of
       check_profile_acls() method. (Fixes: #1234).
     - x2gobroker/tests/test_web_plain_base.py: Add test case for passwords
       with accentuated characters (using the testsuite_authmech for now).
     - Makefile: Support skipping installation of the x2gobroker PyModule.
       Useful when building with CDBS on Debian.
     - Makefile: Compress man pages.
     - Makefile: Run setup.py build at build time.
     - tmpfiles.d utilization: Create RUNDIR/x2gobroker via tmpfiles.d system.
       Fixes missing dir and flawed permissions when running under systemd.
     - etc/x2gobroker.conf: Mention the per-profile option for enabling/disabling
       load checker support.
     - sbin/{x2gobroker-pubkeyauthorizer,x2gobroker-keygen}: Use proper octal
       numbers for file permissions.
     - sbin/x2gobroker-pubkeyauthorizer: Fix key lookup in os.environ for
       Python3.
     - sbin/x2gobroker-pubkeyauthorizer: Some string/bytecode fixes for Python3.
       Plus urllib -> urllib.request.
     - sbin/x2gobroker-pubkeyauthorizer: Improve key integrity checker and move
       it further up. Plus one more Python2 -> Python3 issue fixed.
     - sbin/x2gobroker-pubkeyauthorizer: Drop unused binascii import.
     - x2gobroker-pubkeyauthorizer: Tiny Python2to3 fix.
     - load checker integration: Make the default-use-load-checker option work
       like all other default-* options.
     - uccs frontend: Convert datetime.datetime object to string before answering
       the http request with it.
     - x2gobroker/agent (check_load()): Bail out if no remote agent is given.
     - x2gobroker-testagent: Convert to Python3 (using 2to3 tool).
     - x2gobroker-loadchecker: Python3'ify iteration over dict keys.
     - x2gobroker/utils.py: Provide helper functions for pretty-formatting key
       fingerprints.
     - x2gobroker-keygen: Use new fingerprint formatting functions.
     - x2gobroker/agent.py: Bail out if no hostaddr contained in remote_agent.
     - x2gobroker/agent.py: No load-checking when remote_agent is set to 'LOCAL'.
     - x2gobroker/agent.py: Better sanity checks for remote_agent and its dict
       keys hostname and hostaddr.
     - x2gobroker/loadchecker.py: Report properly to the logger if we fail to
       obtain a load factor.
     - x2gobroker-loadchecker.service: loadchecker service needs to chuid to
       system user x2gobroker. (Fixes: #1252).
     - x2gobroker-loadchecker.service: File ownership should be
       x2gobroker:x2gobroker, too.
     - x2gobroker-loadchecker: No chown/chmod if we are not running as root
       (which is mostly the case).
     - x2gobroker/brokers/inifile_broker.py: Make sure profile['name'] has a
       fallback if not given in the session profile.
     - x2gobroker/brokers/inifile_broker.py: Also check for presence of 'host'
       and 'sshport'.
     - UCCS API change for X2Go Sessions: Rename "SessionType" to "Command".
     - obligatory profile keys: Move from inifile backend to UCCS frontend, as
       those requirements are frontend specific.
     - UCCS: Start working on API version 5.
     - x2gobroker/uccsjson.py: Hide private Python class properties from JSON
       dict (like <obj>._api_version).
     - UCCS frontend: Fix API version check.
     - UCSS frontend: Propagate API version onwards to the X2GoServer JSON
       generator class.
     - infile broker backend: Fix handling of empty lists in session profile
       and session profile defaults.
     - etc/x2gobroker-wsgi.apache.*: Drop Apache2.2 support.
     - Log to system broker.log file when run via x2gobroker-ssh.
     - Getting started documentation: Rework document, convert to markdown,
       install into x2gobroker bin:pkg (on DEB based systems).
     - Makefile.docupload: Add apidoc target (running sphinx-apidoc).
     - docs/source: Initialize Sphinx API documentation's .rst files.
     - bin/x2gobroker: If binding the http server fails, a non-zero exit code
       should be returned. (Fixes: #1013).
     - x2gobroker/loadchecker.py: Don't re-read the x2gobroker.conf during
       each cycle of the load checking loop. Rather read it on service startup
       and require a service restart when x2gobroker.conf has been changed.
     - x2gobroker/loadchecker.py: Avoid rare cases where at the end of a load
       checking cycle a negative sleep time would have been calculated.
       (Fixes: #1315). Thanks to Walid Moghrabi for catching this.
     - HTTP broker: Add &login=<server_user> support to plain and json broker
       frontends.
     - SSH broker: Add --login option. This now supports X2Go Broker user and
       X2Go Server username being different accounts.
     - bin/x2gobroker: Correctly use split_host_address() function call.
     - bin/x2gobroker: Don't override already defined logger objects, define
       them properly where needed.
     - Convert one more unicode object into (Python3) string.
     - x2gobroker/tests/test_broker_agent.py: Assure that tests are run without
       loadchecker usage.
     - broker-use-load-checker profile option: Also tolerate 'TRUE' and 'True'.
     - x2gobroker/agent.py: Fix failing execution of LOCAL broker agent. As
       the LOCAL broker agent is executed setuid root, we cannot
       Popen.terminate() (which is unneeded anyway) the process after its
       execution.
     - Ignore SSH broker events for now. Not sure if we will ever support that.
     - Finalize API documentation.
     - Fix regression flaw in x2gobroker/web/json.py, introduced by commit
       9fa371e9.
   * debian/*:
     + Trigger Makefile's install target and install those files. Drop debhelper
       from-source-installation magic.
   * debian/{control,compat}: Bump to DH version level 9.
   * debian/{control,x2gobroker-common.install}:
     + Split out common files into non-Pythonian bin:pkg.
   * debian/*.install:
     + Add EOLs at EOF.
     + Add tmpfiles.d files into bin:pkgs.
     + Fix installation to /usr/lib/python3.x paths.
   * debian/control:
     + Drop from D (several bin:pkgs): python3-argparse, argparse is shipped
       with Python3 core.
     + Switch from libapache2-mod-wsgi to libapache2-mod-wsgi-py3.
     + Add B-D: dh-python.
     + Add B-D: python3-netaddr (for unit tests).
   * debian/x2gobroker-loadchecker.postinst:
     + Do chown/chmod on the correct file (not authservice.log, but
       loadchecker.log).
   * debian/python-x2gobroker-doc.doc-base:
     + Drop leading white-space in Abstract: field.
   * x2gobroker.spec:
     + Adapt to Python3 port.
     + Bump package version.
     + CentOS 6 + 7 have python34-devel, not python3-devel.
     + Enable debug_packages for openSUSE Tumbleweed (suse_version > 1500).
     + CentOS 6 + 7 have python34-setuptools, not python3-setuptools.
     + Fix removal of conf files in tmpfiles.d where needed.
     + Install tmpfiles.d configs into bin:pkgs.
     + Only install tmpfiles.d configs on systems that support/have systemd.
     + Some path fixes for the new tmpfiles.d/.
     + Make sure the build chroot has all it needs to run the PyModule's unit
       tests.
     + Let's try to get unit tests working on Fedora first...
 .
   [ Mihai Moldovan ]
   * New upstream version (0.0.4.0):
     - src/x2gobroker-{agent,ssh}.c: catch errors in setuid wrappers and add
       general return clause to make compilers happy.
     - Makefile: make sure that we actually append our custom CFLAGS and
       LDFLAGS values, even if passed in through the make command line.
     - src/x2gobroker-{agent,ssh}.c: fix compile warnings/errors.
     - src/x2gobroker-{agent,ssh}.c: fix more compile errors.
     - misc: copyright update.
     - misc: switch to HTTPS-based URLs where appropriate.
     - man/*: update date and version stamps pre-release.
     - misc: add missing coding modelines.
   * x2gobroker.spec:
     - Add %debug_package macro when debugging is to be enabled, hoping that it
       will actually generate proper debuginfo (and -source) sub packages
       owning files.
     - Whitespace only.
     - Remove obsolete EPEL 5 support.
     - Switch to HTTPS-based links.
     - Use more curly braces.
     - Pull in gcc and redhat-rpm-config.
     - Re-enable debug file generation to see which OS versions still fail.
     - %exclude does not work with curly braces, revert.
     - Remove %debug_package macro usage, breaks builds nowadays.
     - Pass down global flags in CFLAGS and LDFLAGS.
     - Fix %{__global_ldflags} usage if variable does not exist.
     - Commands don't seem to work when wrapped in curly braces (at least on
       *SuSE), so revert.


Marked Bug as done Request was from X2Go Release Manager X2Go Release Manager <git-admin@x2go.org> to control@bugs.x2go.org. (Sat, 02 Feb 2019 21:10:15 GMT) Full text and rfc822 format available.

Notification sent to Stefan Baur <X2Go-ML-1@baur-itcs.de>:
Bug acknowledged by developer. (Sat, 02 Feb 2019 21:10:16 GMT) Full text and rfc822 format available.

Message sent on to Stefan Baur <X2Go-ML-1@baur-itcs.de>:
Bug#1013. (Sat, 02 Feb 2019 21:10:24 GMT) Full text and rfc822 format available.

Bug archived. Request was from Debbugs Internal Request <owner@bugs.x2go.org> to internal_control@bugs.x2go.org. (Sun, 03 Mar 2019 06:24:01 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


X2Go Developers <owner@bugs.x2go.org>. Last modified: Mon Jul 15 22:12:07 2019; Machine Name: ymir.das-netzwerkteam.de

X2Go Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.