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

Internal Server Error #4

Closed
polarathene opened this issue Nov 30, 2019 · 4 comments
Closed

Internal Server Error #4

polarathene opened this issue Nov 30, 2019 · 4 comments

Comments

@polarathene
Copy link

polarathene commented Nov 30, 2019

I'm fairly sure I've configured everything correctly, but the container seems to break upon starting up. I have verified that the /.well-known/openid-configuration route to my auth provider is returning valid data response.

Attaching to discourse-bridge
discourse-bridge    | *** Starting uWSGI 2.0.15-debian (64bit) on [Sat Nov 30 04:45:14 2019] ***
discourse-bridge    | compiled with version: 7.3.0 on 28 September 2018 15:41:15
discourse-bridge    | os: Linux-4.15.0-47-generic #50-Ubuntu SMP Wed Mar 13 10:44:52 UTC 2019
discourse-bridge    | nodename: 3f5afec72029
discourse-bridge    | machine: x86_64
discourse-bridge    | clock source: unix
discourse-bridge    | pcre jit disabled
discourse-bridge    | detected number of CPU cores: 1
discourse-bridge    | current working directory: /
discourse-bridge    | detected binary path: /usr/bin/uwsgi-core
discourse-bridge    | dropping root privileges as early as possible
discourse-bridge    | chdir() to /app
discourse-bridge    | your memory page size is 4096 bytes
discourse-bridge    | detected max file descriptor number: 1048576
discourse-bridge    | lock engine: pthread robust mutexes
discourse-bridge    | thunder lock: disabled (you can enable it with --thunder-lock)
discourse-bridge    | uwsgi socket 0 bound to TCP address 0.0.0.0:8080 fd 3
discourse-bridge    | dropping root privileges after socket binding
discourse-bridge    | Python version: 3.6.7 (default, Oct 22 2018, 11:32:17)  [GCC 8.2.0]
discourse-bridge    | *** Python threads support is disabled. You can enable it with --enable-threads ***
discourse-bridge    | Python main interpreter initialized at 0x555fbe868dd0
discourse-bridge    | dropping root privileges after plugin initialization
discourse-bridge    | your server socket listen backlog is limited to 100 connections
discourse-bridge    | your mercy for graceful operations on workers is 60 seconds
discourse-bridge    | mapped 402621 bytes (393 KB) for 2 cores
discourse-bridge    | *** Operational MODE: preforking ***
discourse-bridge    | Traceback (most recent call last):
discourse-bridge    |   File "/usr/local/lib/python3.6/dist-packages/discourse_sso_oidc_bridge/__init__.py", line 3, in <module>
discourse-bridge    |     from .app import app, create_app
discourse-bridge    |   File "/usr/local/lib/python3.6/dist-packages/discourse_sso_oidc_bridge/app.py", line 278, in <module>
discourse-bridge    |     app = create_app()
discourse-bridge    |   File "/usr/local/lib/python3.6/dist-packages/discourse_sso_oidc_bridge/app.py", line 104, in create_app
discourse-bridge    |     app=app,
discourse-bridge    |   File "/usr/local/lib/python3.6/dist-packages/flask_pyoidc/flask_pyoidc.py", line 55, in __init__
discourse-bridge    |     self.init_app(app)
discourse-bridge    |   File "/usr/local/lib/python3.6/dist-packages/flask_pyoidc/flask_pyoidc.py", line 65, in init_app
discourse-bridge    |     for (name, configuration) in self._provider_configurations.items()
discourse-bridge    |   File "/usr/local/lib/python3.6/dist-packages/flask_pyoidc/flask_pyoidc.py", line 65, in <dictcomp>
discourse-bridge    |     for (name, configuration) in self._provider_configurations.items()
discourse-bridge    |   File "/usr/local/lib/python3.6/dist-packages/flask_pyoidc/pyoidc_facade.py", line 54, in __init__
discourse-bridge    |     provider_metadata['issuer'])
discourse-bridge    |   File "/usr/local/lib/python3.6/dist-packages/oic/oic/__init__.py", line 963, in handle_provider_config
discourse-bridge    |     if pcr["issuer"].endswith("/"):
discourse-bridge    | AttributeError: 'NoneType' object has no attribute 'endswith'
discourse-bridge    | unable to load app 0 (mountpoint='') (callable not found or import error)
discourse-bridge    | *** no app loaded. going in full dynamic mode ***
discourse-bridge    | dropping root privileges after application loading
discourse-bridge    | *** uWSGI is running in multiple interpreter mode ***
discourse-bridge    | spawned uWSGI master process (pid: 1)
discourse-bridge    | spawned uWSGI worker 1 (pid: 8, cores: 1)
discourse-bridge    | spawned uWSGI worker 2 (pid: 9, cores: 1)
@polarathene
Copy link
Author

polarathene commented Nov 30, 2019

Ok, resolved. The problem was that I provided my OIDC_ISSUER URL with a forwardslash at the end, that triggers the error in upstream lib you depend on to handle that case. Removing the forward slash doesn't trigger it and everything works fine.

The line was removed from that dependency in this commit. I don't know if the bug has been fixed, you depend on flash-pyoidc 2.0.0(has a 3.0.0 release since) that utilizes depends on pyoidc/oic, except it currently depends on oic 0.12, version 0.12 was released in September 2017, quite a bit of development has happened since with the latest release being in November 2019.

So this isn't something you can fix until flash-pyoidc does(I've raised an issue there about it). In the meantime, this issue will probably help anyone else that runs into the problem.

@polarathene
Copy link
Author

@consideRatio hello, flask-pyoidc has updated with a new version addressing this, v3.1.0. Updating to this version should avoid anyone else running into this problem :)

@consideRatio
Copy link
Owner

Thanks for a very good summary of what i need to know! I aim to update and test stuff before the week ends!

@consideRatio
Copy link
Owner

consideRatio commented Dec 5, 2019

We are now updated with various dependencies ;)

Thanks for reporting this very clearly to me and others! ❤️ 🌻

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