{"action":"closed","issue":{"url":"https://api.github.com/repos/mantidproject/mantid/issues/24339","repository_url":"https://api.github.com/repos/mantidproject/mantid","labels_url":"https://api.github.com/repos/mantidproject/mantid/issues/24339/labels{/name}","comments_url":"https://api.github.com/repos/mantidproject/mantid/issues/24339/comments","events_url":"https://api.github.com/repos/mantidproject/mantid/issues/24339/events","html_url":"https://github.com/mantidproject/mantid/issues/24339","id":391078989,"node_id":"MDU6SXNzdWUzOTEwNzg5ODk=","number":24339,"title":"Segmentation fault when DownloadInstrument without internet connection","user":{"login":"marshallmcdonnell","id":17032543,"node_id":"MDQ6VXNlcjE3MDMyNTQz","avatar_url":"https://avatars1.githubusercontent.com/u/17032543?v=4","gravatar_id":"","url":"https://api.github.com/users/marshallmcdonnell","html_url":"https://github.com/marshallmcdonnell","followers_url":"https://api.github.com/users/marshallmcdonnell/followers","following_url":"https://api.github.com/users/marshallmcdonnell/following{/other_user}","gists_url":"https://api.github.com/users/marshallmcdonnell/gists{/gist_id}","starred_url":"https://api.github.com/users/marshallmcdonnell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marshallmcdonnell/subscriptions","organizations_url":"https://api.github.com/users/marshallmcdonnell/orgs","repos_url":"https://api.github.com/users/marshallmcdonnell/repos","events_url":"https://api.github.com/users/marshallmcdonnell/events{/privacy}","received_events_url":"https://api.github.com/users/marshallmcdonnell/received_events","type":"User","site_admin":false},"labels":[{"id":177607615,"node_id":"MDU6TGFiZWwxNzc2MDc2MTU=","url":"https://api.github.com/repos/mantidproject/mantid/labels/Component:%20Framework","name":"Component: Framework","color":"009800","default":false},{"id":40046083,"node_id":"MDU6TGFiZWw0MDA0NjA4Mw==","url":"https://api.github.com/repos/mantidproject/mantid/labels/Misc:%20Bug","name":"Misc: Bug","color":"d4c5f9","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/mantidproject/mantid/milestones/68","html_url":"https://github.com/mantidproject/mantid/milestone/68","labels_url":"https://api.github.com/repos/mantidproject/mantid/milestones/68/labels","id":3113735,"node_id":"MDk6TWlsZXN0b25lMzExMzczNQ==","number":68,"title":"Release 3.14 (4.0?)","description":"Code freeze: 1st Mar\r\nBeta test: 6th - 19th Mar","creator":{"login":"NickDraper","id":1017173,"node_id":"MDQ6VXNlcjEwMTcxNzM=","avatar_url":"https://avatars1.githubusercontent.com/u/1017173?v=4","gravatar_id":"","url":"https://api.github.com/users/NickDraper","html_url":"https://github.com/NickDraper","followers_url":"https://api.github.com/users/NickDraper/followers","following_url":"https://api.github.com/users/NickDraper/following{/other_user}","gists_url":"https://api.github.com/users/NickDraper/gists{/gist_id}","starred_url":"https://api.github.com/users/NickDraper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NickDraper/subscriptions","organizations_url":"https://api.github.com/users/NickDraper/orgs","repos_url":"https://api.github.com/users/NickDraper/repos","events_url":"https://api.github.com/users/NickDraper/events{/privacy}","received_events_url":"https://api.github.com/users/NickDraper/received_events","type":"User","site_admin":false},"open_issues":299,"closed_issues":925,"state":"open","created_at":"2018-02-13T15:42:17Z","updated_at":"2019-01-04T15:58:02Z","due_on":"2019-03-25T07:00:00Z","closed_at":null},"comments":7,"created_at":"2018-12-14T11:45:52Z","updated_at":"2019-01-04T15:58:02Z","closed_at":"2019-01-04T15:58:02Z","author_association":"CONTRIBUTOR","body":"**Original reporter:** @marshallmcdonnell \r\n\r\n### Expected behavior\r\nIf `DownloadInstrument` fails, it should do so \"gracefully\" and maybe with a better error than the all so helpful \"Segmentation Fault\"\r\n\r\n### Actual behavior\r\n\r\nThis may be a special case but we are trying to run the Mantid Framework inside the nightly Docker containers [ [Dockerfiles](https://github.com/mantidproject/dockerfiles) and [Images on DockerHub](https://hub.docker.com/r/mantidproject/mantid/tags) ]. When issuing `import mantid.simpleapi`, the [`DownloadInstrument`](http://docs.mantidproject.org/v3.5.1/algorithms/DownloadInstrument-v1.html)  algorithm will cause a segmentation fault on starting up the Framework.  Will segmentation fault after writing the `github.json` in the `$HOME/.mantid` directory. \r\n\r\nThe workaround for now is to issue the following bash command before trying to use the Framework (with the assumption you already have the instrument definition files):\r\n\r\n```\r\necho \"UpdateInstrumentDefinitions.OnStartup = 0\" > /root/.mantid/Mantid.user.properties\r\n```\r\n\r\nWith help of @quantumsteve, tried to get a backtrace using (pseudo-code) `gdb python && run && import mantid.simpleapi && bt` but running over night it never exited the import statement so never able to get to the `bt` command.\r\n\r\nNOTE: Interestingly, running it a second time after the initial seg fault (running `python -c import mantid.simpleapi` again) will work without the seg fault since `DownloadInstrument` now \"believes\" `All instrument definitions up to date`.  I just assume this is because the  `$HOME/.mantid/github.json` exists. Example below of running command twice from an interactive session  launched using `docker run -it mantidproject/mantid:nightly_ubuntu16.04 /bin/bash -c \"MANTIDPATH=/opt/mantidnightly/bin && export PYTHONPATH=${MANTIDPATH}:${PYTHONPATH} && bash\"`\r\n\r\n```\r\nroot@e9c4c6651ce0:/# python -c \"import mantid.simpleapi\"\r\n/usr/lib/python2.7/dist-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.\r\n  warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')\r\nFrameworkManager-[Notice] Welcome to Mantid 3.13.20181212.1445\r\nFrameworkManager-[Notice] Please cite: http://dx.doi.org/10.1016/j.nima.2014.07.029 and this release: http://dx.doi.org/10.5286/Software/Mantid\r\nDownloadInstrument-[Notice] Downloading 6 files from the instrument repository\r\nSegmentation fault (core dumped)\r\n\r\nroot@e9c4c6651ce0:/# python -c \"import mantid.simpleapi\"\r\nFrameworkManager-[Notice] Welcome to Mantid 3.13.20181212.1445\r\nFrameworkManager-[Notice] Please cite: http://dx.doi.org/10.1016/j.nima.2014.07.029 and this release: http://dx.doi.org/10.5286/Software/Mantid\r\nDownloadInstrument-[Notice] All instrument definitions up to date\r\n```\r\n\r\n### Steps to reproduce the behavior\r\n\r\nAffects all three nightly docker images so pick either of the following (the `nightly` is equivalent to `nightly_centos7`):\r\n```\r\ndocker run -it mantidproject/mantid:nightly_ubuntu16.04 /bin/bash -c \"MANTIDPATH=/opt/mantidnightly/bin && export PYTHONPATH=${MANTIDPATH}:${PYTHONPATH} && python -c 'import mantid.simpleapi'\"\r\n```\r\nor \r\n```\r\ndocker run -it mantidproject/mantid:nightly_centos7/bin/bash -c \"MANTIDPATH=/opt/mantidnightly/bin && export PYTHONPATH=${MANTIDPATH}:${PYTHONPATH} && python -c 'import mantid.simpleapi'\"\r\n```\r\n\r\nTo get the logging at debug level, you can issue the following:\r\n```\r\ndocker run -it mantidproject/mantid:nightly_ubuntu16.04 /bin/bash -c \"mkdir /root/.mantid/ && echo 'logging.loggers.root.level=debug' > /root/.mantid/Mantid.user.properties && MANTIDPATH=/opt/mantidnightly/bin && export PYTHONPATH=${MANTIDPATH}:${PYTHONPATH} && python -c 'import mantid.simpleapi'\"\r\n```\r\n\r\nI uploaded the output of this `debug` logging if it helps but I did not see anything immediately pop out at me:\r\n[debug_output.txt](https://github.com/mantidproject/mantid/files/2679922/debug_output.txt)\r\n\r\n### Platforms affected\r\nDocker images of the nightly found [here](https://hub.docker.com/r/mantidproject/mantid/tags) but most likely all docker images or computers without internet connection are affected, I assume.\r\n\r\nOne last note is we were trying to just use the docker containers for running tests with the Framework. Yet, issuing `pytest` would just issue the segmentation fault so it took some time investigating to pin point both the Mantid Framework and the `DownloadInstrument` algorithm as the culprits\r\n\r\n"}}
{"actor":{"display_login":"marshallmcdonnell"}}