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

Wrong Python default path in QGIS server on macOS #29843

Closed
qgib opened this issue May 9, 2019 · 6 comments
Closed

Wrong Python default path in QGIS server on macOS #29843

qgib opened this issue May 9, 2019 · 6 comments
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers macOS Server Related to QGIS server stale Uh oh! Seems this work is abandoned, and the PR is about to close.

Comments

@qgib
Copy link
Contributor

qgib commented May 9, 2019

Author Name: vince - (vince -)
Original Redmine Issue: 22029
Affected QGIS version: 3.6.2
Redmine category:qgis_server


It appears that QGis server layout is broken when compiled on MacOS. Frameworks are expected in @loader_path/../../Frameworks/ whereas the right access path is @loader_path/../../../../Frameworks and for libraries instead of @loader_path/../lib this is @loader_path/../../lib. This is inconvenient, though fixable using install_name_tool.

However, when QGIS server starts, the path given to the Python interpreter is wrong, and that causes the server to fail

Initializing server modules from "/Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/lib/qgis/server"

"Checking /Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/lib/qgis/server for native services modules"
"Loading native module /Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/lib/qgis/server/libdummy.so"
"Loading native module /Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/lib/qgis/server/libwcs.so"
"Loading native module /Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/lib/qgis/server/libwfs.so"
"Loading native module /Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/lib/qgis/server/libwms.so"
"Loading native module /Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/lib/qgis/server/libwmts.so"

"Couldn't load SIP module.
Python support will be disabled.

Traceback (most recent call last):
  File \"\", line 1, in 
ModuleNotFoundError: No module named 'qgis'

Python version:
3.6.8 (default, Dec 30 2018, 13:01:27) 
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)]

QGIS version:
3.6.2-Noosa 'Noosa', exported

Python path:
['/Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/../Resources/python', '/Users/lore/Library/Application Support/QGIS/QGIS3/profiles/default/python', '/Users/lore/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins', '/Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/../Resources/python/plugins', '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6', '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload', '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages']" 
"An error occurred during execution of following code:
qgis.utils.uninstallErrorHook()

Traceback (most recent call last):
  File \"\", line 1, in 
NameError: name 'qgis' is not defined

Python version:
3.6.8 (default, Dec 30 2018, 13:01:27) 
[GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)]

QGIS version:
3.6.2-Noosa 'Noosa', exported

Python path:
['/Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/../Resources/python', '/Users/lore/Library/Application Support/QGIS/QGIS3/profiles/default/python', '/Users/lore/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins', '/Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/../Resources/python/plugins', '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python36.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6', '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/lib-dynload', '/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages']" QFSFileEngine::open: No file name specified Content-Length: 54 Content-Type: text/xml; charset=utf-8 Server: Qgis FCGI server - QGis version 3.6.2-Noosa Status: 500 Project file error

This path: '/Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/../Resources/python' is wrong. It should be '/Applications/MacPorts/Qgis3.app/Contents/MacOS/fcgi-bin/../../Resources/python'. So far I have failed to find out where this path was set (in order to correct it). Can anyone help?

@qgib
Copy link
Contributor Author

qgib commented May 9, 2019

Author Name: Giovanni Manghi (@gioman)


  • crashes_corrupts_data was changed from 1 to 0
  • operating_system was changed from MacOS X to macOS
  • subject was changed from Wrong Python default path in QGis server to Wrong Python default path in QGIS server on macOS

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server labels May 25, 2019
@alexbruy alexbruy added the macOS label Apr 19, 2020
@PeterPetrik PeterPetrik self-assigned this Sep 23, 2020
@PeterPetrik
Copy link
Contributor

Can you please test with https://qgis.org/downloads/macos/nightly2/qgis_nightly2_master_20200923_062253.dmg
You can run /Applications/QGIS.app/Contents/MacOS/bin/qgis_mapserver with QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES environment variable to your project folder

@PeterPetrik PeterPetrik added the Feedback Waiting on the submitter for answers label Sep 23, 2020
@PeterPetrik
Copy link
Contributor

cc @gioman

@gioman
Copy link
Contributor

gioman commented Sep 23, 2020

@PeterPetrik I never tested QGIS Server on macOS, I guess I can try.

@gioman gioman removed the Feedback Waiting on the submitter for answers label Dec 22, 2020
@PeterPetrik
Copy link
Contributor

I believe this was fixed in QGIS 3.16, cannot we close the issue? @gioman why the Feedback was removed, is there any issue with the implementation ATM?

@gioman gioman added the Feedback Waiting on the submitter for answers label Jan 18, 2021
@github-actions
Copy link

github-actions bot commented Feb 2, 2021

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale".
If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue.
In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue.
If there is no further activity on this issue, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers macOS Server Related to QGIS server stale Uh oh! Seems this work is abandoned, and the PR is about to close.
Projects
None yet
Development

No branches or pull requests

4 participants