Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with WWT in sandbox mode #11

Open
astrofrog opened this issue Jun 20, 2023 · 1 comment
Open

Issue with WWT in sandbox mode #11

astrofrog opened this issue Jun 20, 2023 · 1 comment

Comments

@astrofrog
Copy link
Member

If I enable sandbox mode in the entitlements file so that the .pkg installer is correctly validated, WWT no longer works:

Traceback (most recent call last):
  File "glue/app/qt/application.py", line 988, in _choose_new_data_viewer_nodata
  File "glue/app/qt/application.py", line 1009, in choose_new_data_viewer
  File "glue/core/application_base.py", line 261, in do
  File "glue/core/command.py", line 134, in do
  File "glue/core/command.py", line 235, in do
  File "glue/utils/matplotlib.py", line 191, in wrapper
  File "glue/app/qt/application.py", line 1013, in new_data_viewer
  File "glue/core/application_base.py", line 81, in new_data_viewer
  File "glue/viewers/common/qt/data_viewer.py", line 27, in __call__
  File "glue_wwt/viewer/qt_data_viewer.py", line 30, in __init__
  File "glue_wwt/viewer/data_viewer.py", line 21, in __init__
  File "glue_wwt/viewer/qt_data_viewer.py", line 43, in _initialize_wwt
  File "pywwt/qt.py", line 214, in __init__
  File "pywwt/data_server.py", line 102, in get_data_server
  File "mimetypes.py", line 339, in add_type
  File "mimetypes.py", line 362, in init
  File "mimetypes.py", line 203, in read
PermissionError: [Errno 1] Operation not permitted: '/etc/apache2/mime.types'

I need to investigate whether there is a way around this, or whether we would need to remove glue-WWT in order to produce a functional .pkg installer.

For now I have removed sandbox mode and disabled the .pkg validation: 70c601b

@dhomeier
Copy link

If the file is not world-readable on the sandbox system or this is somehow running in a mode that cannot read the configuration files, pywwt might work around it by stripping the list of known config files before adding the type, e.g.

    mimetypes.knownfiles = ['/etc/mime.types']
    mimetypes.add_type('image/fits', '.fits')
    mimetypes.add_type('image/fits', '.fts')
    mimetypes.add_type('image/fits', '.fit')

but if permissions are that restricted, I am sceptical the next steps of starting the server would actually succeed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants