xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Opened 19 months ago

Closed 19 months ago

Last modified 9 months ago

#2693 closed defect (fixed)

bug in generated run-xpra script causes client connection failure — at Version 1

Reported by: djerius Owned by: Antoine Martin
Priority: major Milestone: 4.0
Component: server Version: 3.0.x
Keywords: Cc:

Description (last modified by Antoine Martin)

The generated script, /run/user/$UID/xpra/run-xpra, incorrectly inserts spaces before the END heredoc marker, causing the remainder of the script to be assigned to the heredoc, resulting a syntax error and a client connection failure.

% tail -17 /run/user/$UID/xpra/run-xpra
GDK_BACKEND='x11'; export GDK_BACKEND
cd '/usr/lib/python3/dist-packages/xpra'
_XPRA_PYTHON='/usr/bin/python3'
_XPRA_SCRIPT='/bin/xpra'

    if which "$_XPRA_PYTHON" > /dev/null && [ -e "$_XPRA_SCRIPT" ]; then
        # Happypath:
        exec "$_XPRA_PYTHON" "$_XPRA_SCRIPT" "$@"
    else
        cat >&2 <<END
        Could not find one or both of '$_XPRA_PYTHON' and '$_XPRA_SCRIPT'
        Perhaps your environment has changed since the xpra server was started?
        I'll just try executing 'xpra' with current PATH, and hope...
    END
        exec xpra "$@"
    fi


% /run/user/$UID/xpra/run-xpra
/run/user/20263/xpra/run-xpra: 122: /run/user/20263/xpra/run-xpra: Syntax error: end of file unexpected (expecting "fi")

The culprit is in server/server_util.py, lines 86-96, where the shell code snippet is not left justified.

By the way, this error is not returned by the Xpra client, regardless of the debug level. The reported error is unhelpful, as it does not include the error message returned by the shell:

2020-03-31 18:04:10,153 Error: failed to receive anything, not an xpra server?
2020-03-31 18:04:10,153   could also be the wrong protocol, username, password or port
2020-03-31 18:04:10,154   or the session was not found
2020-03-31 18:04:10,154 Connection lost

The only way to debug this was by specifying a -v option to ssh:

xpra --ssh 'ssh -v' attach ssh://$HOST/99
[...]
/run/user/20263/xpra/run-xpra: 122: /run/user/20263/xpra/run-xpra: Syntax error: end of file unexpected (expecting "fi")
[...]

It looks like it's correct in trunk,
browser/xpra/trunk/src/xpra/server/server_util.py

but not in 3.0.x?
browser/xpra/tags/v3.0.x/src/xpra/server/server_util.py

Change History (1)

comment:1 Changed 19 months ago by Antoine Martin

Description: modified (diff)
Resolution: fixed
Status: newclosed

The culprit is in server/server_util.py, lines 86-96, where the shell code snippet is not left justified.

Thanks for the report. That's exactly it.
I had tested it with python3, then added the if-else which changed indentation...
trunk doesn't need python2 support, so it doesn't have if-else, or the indentation problem.

Lesson of the day: never apply last minute fixes to a stable branch..
r25876 broke this, r25888 fixes it.

Updated builds are on the way..

Last edited 19 months ago by Antoine Martin (previous) (diff)
Note: See TracTickets for help on using tickets.