Closed ayungman closed 3 years ago
Might be an incompatibility between Python 3.8 and Django 1.9.6, which the project currently uses. Using an older Python version (e.g. 3.6, which the automated tests use) or trying to upgrade to a newer Django version might fix it. The latter is probably preferable, but could lead to further issues.
Try two scenarios - both fail.
dumps
installing manual - successful.
pip3 install -r requirements.txt
However running ./run.py failed with Exception in worker process as shown bellow.
/ws/strongMan
Press CTRL + C to stop strongMan
()
[2021-01-12 15:20:01 +0200] [33078] [INFO] Starting gunicorn 19.5.0
[2021-01-12 15:20:01 +0200] [33078] [INFO] Listening at: http://0.0.0.0:1515 (33078)
[2021-01-12 15:20:01 +0200] [33078] [INFO] Using worker: sync
/usr/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used
return io.open(fd, *args, **kwargs)
[2021-01-12 15:20:01 +0200] [33080] [INFO] Booting worker with pid: 33080
[2021-01-12 15:20:01 +0200] [33081] [INFO] Booting worker with pid: 33081
[2021-01-12 15:20:01 +0200] [33082] [INFO] Booting worker with pid: 33082
[2021-01-12 15:20:02 +0200] [33083] [INFO] Booting worker with pid: 33083
[2021-01-12 15:20:02 +0200] [33084] [INFO] Booting worker with pid: 33084
[2021-01-12 15:20:02 +0200] [33085] [INFO] Booting worker with pid: 33085
[2021-01-12 13:20:02 +0000] [33080] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/ws/strongMan/env/lib/python3.8/site-packages/gunicorn/arbiter.py", line 517, in spawn_worker
worker.init_process()
File "/ws/strongMan/env/lib/python3.8/site-packages/gunicorn/workers/base.py", line 122, in init_process
self.load_wsgi()
File "/ws/strongMan/env/lib/python3.8/site-packages/gunicorn/workers/base.py", line 132, in load_wsgi
self.wsgi = self.app.wsgi()
File "/ws/strongMan/env/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/ws/strongMan/env/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/ws/strongMan/env/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/ws/strongMan/env/lib/python3.8/site-packages/gunicorn/util.py", line 357, in import_app
import(module)
File "/ws/strongMan/strongMan/wsgi.py", line 17, in
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/ws/strongMan/env/bin/gunicorn", line 8, in
You can try the django-update branch, which updates Django and the other dependencies to their latest version. In a quick test it seems to work OK. I noticed one issue, though, which is that strings returned from vici (e.g. on the about page) are wrapped in b''
because they are bytestrings (Django versions < 2 converted/decoded these automatically). Please let me know if you find other stuff that doesn't work.
ok. switching to django-update branch made the trick and strongMan manage to load with no errors or exceptions.
I think that change should be push to master.
I saw the issue you've talked about wrapped in b''
(About menu) and will report if find more issues.
When going to 'Server Connections' menu item I don't see my active/running connection. Should it show me that info? Connection Overview No connections to show
I think that change should be push to master.
Yes, that's definitely the goal once everything seems to work.
I saw the issue you've talked about wrapped in
b''
(About menu) and will report if find more issues.
I've updated the commit and fixed an issue with iframes (e.g. to upload certificates from the connection editor) and the about page now also looks OK (for the decoding of error messages I pushed a fix for the vici Python bindings to the strongSwan repository in the vici-errors-decode branch).
When going to 'Server Connections' menu item I don't see my active/running connection. Should it show me that info?
I don't think so. It will only display connections configured in strongMan itself (i.e. you can't use it to manage connections configured via swanctl.conf or vici directly, instead you have to configure everything via strongMan).
Thanks.
I don't think so. It will only display connections configured in strongMan itself (i.e. you can't use it to manage connections configured via swanctl.conf or vici directly, instead you have to configure everything via strongMan).
ha, a bit disappointment as conflict may occurs. The other direction - If I configure using strongMan, will it be reflected in swanctl conf.d or somewhere else? I guess It must be reflected somehow to StrongSwan, isn't it
ha, a bit disappointment as conflict may occurs.
That's exactly the point. Generally, only one client can currently configure the daemon via vici. So e.g. swanctl would remove connections loaded by strongMan as it can't find these in swanctl.conf. Controlling SAs is less of a problem, that can work with multiple clients.
If I configure using strongMan, will it be reflected in swanctl conf.d or somewhere else?
Not in the config, but you could e.g. list, initiate or terminate connections via swanctl.
I've migrated the automated testing to GitHub Actions and those complete successfully (they don't cover everything, though). But unless you found anything else, I think these changes are ready for merging. What do you think?
Well, saw another thing, not sure if its an issue, after initiate successful connection. Going to "Connection Overview" form and clicking on the "eye" icon to see the "Connection Settings" I am getting always "my-lab-peer refused to connect."
Well, saw another thing, not sure if its an issue, after initiate successful connection.
Does this affect the rest of the web application too? Or only the popup? The latter would be strange, but if the complete site is not reachable anymore that could be because of the VPN connection (depending on the negotiated traffic selectors). You might have to configure bypass policies to avoid covering the web traffic.
Its the latter... :-( Using different network interfaces for the web access and for the VPN. The rest of the app is functional. Pls note that it "refused to connect" when clicking on the "eye" also when VPN connection is not active ("Unloaded")
Hm, no idea, can't reproduce this here, works fine in Firefox and Chrome with hostname or IP address. What browser/version do you use? Did you change any config options (other than ALLOWED_HOSTS
)? Can you follow the request(s) in the browser's developer tools (Network tab)?
I am using chrome from another machine (not the installed one). I changed only ALLOWED_HOSTS to '*' inside file: strongMan/strongMan/settings/base.py I can send you the ip of the server, as you can connect from far also.
I've tried that too, doesn't happen here (although, I only tested in the same LAN). Since you modified base.py
, do you have the changes I made to that file in yours (in particular X_FRAME_OPTIONS = 'SAMEORIGIN'
)? Did you try clearing the browser cache (maybe Chrome stored the previous X-Frame-Options
value and doesn't allow the frame to be loaded)? Did you try the developer tools? You can email me the IP if you want.
Great! that was the problem.
X_FRAME_OPTIONS = 'SAMEORIGIN'
I made that change manually in "/env/lib/python3.8/site-packages/django/conf/global_settings.py"
since it was not there. I guess it's not on the branch django-update.
it is working now. :-) Many thanks for your help - its very nice - thanks!
I made that change manually in "/env/lib/python3.8/site-packages/django/conf/global_settings.py"
You shouldn't modify such third-party files, that's what the local config files are for. base.py
is the base for all configs, the others are loaded depending on the scenario (via DJANGO_SETTINGS_MODULE
).
I guess it's not on the branch django-update.
No, it definitely was in there: https://github.com/strongswan/strongMan/blob/08329559f91c0cdc527af24fad8effc002ea7453/strongMan/settings/base.py#L36
But it's possible you missed it since I force-pushed the branch a couple of times.
Anyway, I'm going to push the changes to master.
i'm having this Error 2 when trying to install strongMan. Need help please python setup.py install Start strongMan installation
./run.py /ws/strongMan Press CTRL + C to stop strongMan () [2021-01-11 17:47:07 +0200] [12226] [INFO] Starting gunicorn 19.5.0 [2021-01-11 17:47:07 +0200] [12226] [INFO] Listening at: http://0.0.0.0:1515 (12226) [2021-01-11 17:47:07 +0200] [12226] [INFO] Using worker: sync /usr/lib/python3.8/os.py:1023: RuntimeWarning: line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used return io.open(fd, *args, **kwargs) [2021-01-11 17:47:07 +0200] [12228] [INFO] Booting worker with pid: 12228 [2021-01-11 17:47:07 +0200] [12229] [INFO] Booting worker with pid: 12229 [2021-01-11 17:47:08 +0200] [12230] [INFO] Booting worker with pid: 12230 [2021-01-11 17:47:08 +0200] [12231] [INFO] Booting worker with pid: 12231 [2021-01-11 17:47:08 +0200] [12232] [INFO] Booting worker with pid: 12232 [2021-01-11 17:47:08 +0200] [12233] [INFO] Booting worker with pid: 12233 [2021-01-11 15:47:08 +0000] [12228] [ERROR] Exception in worker process Traceback (most recent call last): File "/ws/strongMan/env/lib/python3.8/site-packages/gunicorn/arbiter.py", line 517, in spawn_worker worker.init_process() File "/ws/strongMan/env/lib/python3.8/site-packages/gunicorn/workers/base.py", line 122, in init_process self.load_wsgi() File "/ws/strongMan/env/lib/python3.8/site-packages/gunicorn/workers/base.py", line 132, in load_wsgi self.wsgi = self.app.wsgi() : : RuntimeError: class not set defining 'AbstractBaseUser' as <class 'django.contrib.auth.base_user.AbstractBaseUser'>. Was classcell propagated to type.new? [2021-01-11 15:47:08 +0000] [12229] [INFO] Worker exiting (pid: 12229) [2021-01-11 15:47:08 +0000] [12230] [ERROR] Exception in worker process
Following those instruction git clone https://github.com/strongswan/strongMan.git cd strongMan sudo ./setup.py install ./run.py
The version of virtualenv is: virtualenv 20.2.2 from /root/.local/pipx/venvs/virtualenv/lib/python3.8/site-packages/virtualenv/init.py
Running on Ubuntu 20.04.1 LTS, arm64