Closed fplk closed 4 years ago
About the title of this issue... did you check whether the environment variables within the integrated bash and pure bash are the same?
I'm having a similar issue and I noted they are not the same. I can normally run commands in the pure bash, but my PATH for the integrated terminal seems "incomplete". They seem to be the same bash: /bin/bash
returned from echo $0
.
Solution Thanks to @pfitzseb Sebastian Pfitzner's response in the original issue I went down a path that led to the solution. He pointed me to a flag which clearly indicated some X authorization issue caused by sandboxing (see appendix (b)). The issue was that both my VSCode and VSCodium were installed via Snap which did not play well together with opening the external window with the 3D engine. By removing the VSCode Snap and reinstalling the pure version of VSCode this issue vanished (even with the flag Sebastian pointed to set).
So again: Thank you to Gabriel and especially Sebastian - you guys rock and Sebastian essentially deserves the major credit on this one - the error was obvious from where he led me to. Really glad this is solved.
Appendix a) Interesting. My VSCodium has more environment variables than pure bash, but the sets differ. Unique to VSCodium:
'GIT_ASKPASS', 'GIO_LAUNCHED_DESKTOP_FILE', 'VSCODE_GIT_IPC_HANDLE', 'APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL', 'BAMF_DESKTOP_FILE_HINT', 'XDG_CACHE_HOME', 'CHROME_DESKTOP', 'DISABLE_WAYLAND', 'TERM_PROGRAM', 'TERM_PROGRAM_VERSION', 'VSCODE_GIT_ASKPASS_NODE', 'GSETTINGS_SCHEMA_DIR', 'ORIGINAL_XDG_CURRENT_DESKTOP', 'VSCODE_GIT_ASKPASS_MAIN', 'GIO_LAUNCHED_DESKTOP_FILE_PID'
Unique to bash:
'GNOME_TERMINAL_SERVICE', 'GNOME_TERMINAL_SCREEN', 'VTE_VERSION'
b) Sebastian Pfitzner @pfitzseb over at the julia-vscode pointed out an interesting setting: Terminal > Integrated: Inherit Env
. When I disable its checkbox, the error changes to
$ julia minimal_example.jl
[ Info: Importing Revise
[ Info: Importing OhMyREPL
No protocol specified
xdpyinfo: unable to open display ":0.0".
ERROR: LoadError: PyError ($(Expr(:escape, :(ccall(#= /home/falk/.julia/packages/PyCall/zqDXB/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'AssertionError'>
AssertionError('Invalid DISPLAY :0.0 - cannot find X server with xdpyinfo')
File "/home/falk/shapesworld_virtualenv/lib/python3.8/site-packages/machine_common_sense/mcs.py", line 26, in create_controller
return MCS_Controller_AI2THOR(unity_app_file_path, debug, enable_noise)
File "/home/falk/shapesworld_virtualenv/lib/python3.8/site-packages/machine_common_sense/mcs_controller_ai2thor.py", line 111, in __init__
self.__controller = ai2thor.controller.Controller(
File "/home/falk/shapesworld_virtualenv/lib/python3.8/site-packages/ai2thor/controller.py", line 416, in __init__
self.start(
File "/home/falk/shapesworld_virtualenv/lib/python3.8/site-packages/ai2thor/controller.py", line 951, in start
self.check_x_display(env['DISPLAY'])
File "/home/falk/shapesworld_virtualenv/lib/python3.8/site-packages/ai2thor/controller.py", line 799, in check_x_display
assert subprocess.call("xdpyinfo", stdout=dn, env=env, shell=True) == 0, \
Stacktrace:
[1] pyerr_check at /home/falk/.julia/packages/PyCall/zqDXB/src/exception.jl:60 [inlined]
[2] pyerr_check at /home/falk/.julia/packages/PyCall/zqDXB/src/exception.jl:64 [inlined]
[3] _handle_error(::String) at /home/falk/.julia/packages/PyCall/zqDXB/src/exception.jl:81
[4] macro expansion at /home/falk/.julia/packages/PyCall/zqDXB/src/exception.jl:95 [inlined]
[5] #110 at /home/falk/.julia/packages/PyCall/zqDXB/src/pyfncall.jl:43 [inlined]
[6] disable_sigint at ./c.jl:446 [inlined]
[7] __pycall! at /home/falk/.julia/packages/PyCall/zqDXB/src/pyfncall.jl:42 [inlined]
[8] _pycall!(::PyObject, ::PyObject, ::Tuple{String}, ::Int64, ::Ptr{Nothing}) at /home/falk/.julia/packages/PyCall/zqDXB/src/pyfncall.jl:29
[9] _pycall! at /home/falk/.julia/packages/PyCall/zqDXB/src/pyfncall.jl:11 [inlined]
[10] #_#117 at /home/falk/.julia/packages/PyCall/zqDXB/src/pyfncall.jl:86 [inlined]
[11] (::PyObject)(::String) at /home/falk/.julia/packages/PyCall/zqDXB/src/pyfncall.jl:86
[12] top-level scope at /home/falk/Documents/minimal_example.jl:24
[13] include(::Function, ::Module, ::String) at ./Base.jl:380
[14] include(::Module, ::String) at ./Base.jl:368
[15] exec_options(::Base.JLOptions) at ./client.jl:296
[16] _start() at ./client.jl:506
in expression starting at /home/falk/Documents/minimal_example.jl:24
which is very similar to an error you would get if your Xauthority was messed up, e.g. in a Docker X passthrough setting, where you'd have to run something like
sudo rmdir /tmp/.docker.xauth
touch /tmp/.docker.xauth
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f /tmp/.docker.xauth nmerge -
to resolve this. Which gave me the idea for the solution above: Sandboxing or, more precisely, Snap. See main answer above.
@fplk I'm glad you solve your issue. I solved mine with an workaround and will do some tests to see whether it makes sense to open an issue.
As a side note, Julia is awesome and I aim to use it on the near future, nice to see its community grow :smile:
Steps to Reproduce:
Good news: I have built two minimal examples and me and others were able to reproduce the error with it. Bad news: Since the observed instance occurs when running a Unity environment, you require a few dependencies (but it should only take a few minutes to set them up). I will show the same error both with Julia 1.5.0 and Python 3.8.2:
Julia Version
Note that these are from a well-known DARPA-affiliated company and the details are explained here, so there should be no security concerns about running it. [It is also fully public and I have explicit clearance to post the code below.] You need to make the first file executable (Linux binary!), extract the second file right next to it and finally extract the third archive somewhere.
Install the pip dependencies in 3 steps:
pip3 install -r requirements.txt
with this requirements filepip3 show ai2thor
pip3 install git+https://github.com/NextCenturyCorporation/MCS@latest
Create a file
minimal_example.jl
with the following content, but please adaptscene_path
below to point to the file with the same name in extracted folder from the third file as well asmcs_executable_path
to point to the executable from file 1.pathlib = pyimport("pathlib")
solution = push!([push!([push!([push!([push!([push!([ "RotateLook, rotation=-40"], "MoveAhead, amount=1.0", "MoveAhead, amount=0.5", "RotateLook, rotation=-90"); repeat(["MoveAhead, amount=1.0"], 3)], "MoveAhead, amount=0.5"); repeat(["RotateLook, rotation=-40"], 9); repeat(["MoveAhead, amount=1.0"], 4)], "RotateLook, rotation=-45"); repeat(["MoveAhead, amount=1.0"], 8)], "RotateLook, rotation=37"); repeat(["MoveAhead, amount=1.0"], 2)], "PickupObject, objectId=96c608b1-8b50-4dea-a12e-541a3204912a", "RotateLook, rotation=185"); repeat(["MoveAhead, amount=1.0"], 6)], "RotateLook, horizon=45", "DropObject, objectId=96c608b1-8b50-4dea-a12e-541a3204912a")
scene_path="/home/falk/mitibm/AI2Thor_MCS/dataset_eval2/interaction_scenes/transferral_goal-0772.json" mcs_executable_path="/home/falk/mitibm/AI2Thor_MCS/MCS-AI2-THOR-Unity-App-v0.0.10.x86_64" config_data, status = MCS.load_config_json_file(scene_path) controller = MCS.create_controller(mcs_executable_path) output = controller.start_scene(config_data) for next_action in solution output = controller.step(next_action) end classification = "classification" confidence = 1.0 controller.end_scene(classification, confidence)
Debug info from gdb:
I refuse to debug myself! No threads.
================================================================= Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.
Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/falk/shapesworld_virtualenv/lib/python3.8/site-packages/ai2thor/controller.py", line 782, in _start_unity_thread raise Exception("command: %s exited with %s" % (command, returncode)) Exception: command: ['/home/falk/mitibm/AI2Thor_MCS/MCS-AI2-THOR-Unity-App-v0.0.10.x86_64', '-screen-fullscreen', '0', '-screen-quality', '3', '-screen-width', '600', '-screen-height', '400'] exited with -6
from machine_common_sense.mcs import MCS
scene_path="/home/falk/mitibm/AI2Thor_MCS/dataset_eval2/interaction_scenes_training/transferral_goal-0772.json" mcs_executable_path="/home/falk/mitibm/AI2Thor_MCS/MCS-AI2-THOR-Unity-App-v0.0.10.x86_64"
solution = [] solution += ['RotateLook, rotation=-40'] + ['MoveAhead, amount=1.0'] + \ ['MoveAhead, amount=0.5'] + ['RotateLook, rotation=-90'] + \ ['MoveAhead, amount=1.0'] 3 + ['MoveAhead, amount=0.5'] + \ ['RotateLook, rotation=-40'] 9 + ['MoveAhead, amount=1.0'] 4 + \ ['RotateLook, rotation=-45'] + ['MoveAhead, amount=1.0'] 8 + \ ['RotateLook, rotation=37'] + ['MoveAhead, amount=1.0'] 2 + \ ['PickupObject, objectId=96c608b1-8b50-4dea-a12e-541a3204912a'] + \ ['RotateLook, rotation=185'] + ['MoveAhead, amount=1.0'] 6 + \ ['RotateLook, horizon=45'] + \ ['DropObject, objectId=96c608b1-8b50-4dea-a12e-541a3204912a']
config_data, status = MCS.load_config_json_file(scene_path) controller = MCS.create_controller(mcs_executable_path) output = controller.start_scene(config_data) for next_action in solution: output = controller.step(next_action) classification = "classification" confidence = 1.0
$ python3 minimal_example.py Found path: /home/falk/mitibm/AI2Thor_MCS/MCS-AI2-THOR-Unity-App-v0.0.10.x86_64 Mono path[0] = '/home/falk/mitibm/AI2Thor_MCS/MCS-AI2-THOR-Unity-App-v0.0.10_Data/Managed' Mono config path = '/home/falk/mitibm/AI2Thor_MCS/MCS-AI2-THOR-Unity-App-v0.0.10_Data/Mono/etc' Preloaded 'ScreenSelector.so' Display 0 'PHL 328E1 31"': 3840x2160 (primary device). Display 1 'PHL 328E1 31"': 3840x2160 (secondary device). Display 2 'PHL 278E1 27"': 3840x2160 (secondary device). Loading player data from /home/falk/mitibm/AI2Thor_MCS/MCS-AI2-THOR-Unity-App-v0.0.10_Data/data.unity3d Logging to /home/falk/.config/unity3d/CACI with the Allen Institute for Artificial Intelligence/MCS-AI2-THOR/Player.log Stacktrace:
Native stacktrace:
Debug info from gdb:
I refuse to debug myself! No threads.
================================================================= Got a SIGABRT while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application.
Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/home/falk/.local/lib/python3.8/site-packages/ai2thor/controller.py", line 782, in _start_unity_thread raise Exception("command: %s exited with %s" % (command, returncode)) Exception: command: ['/home/falk/mitibm/AI2Thor_MCS/MCS-AI2-THOR-Unity-App-v0.0.10.x86_64', '-screen-fullscreen', '0', '-screen-quality', '3', '-screen-width', '600', '-screen-height', '400'] exited with -6