Closed Kalyan-M closed 4 years ago
Thanks for opening a report! The logs are from systemd trying to restart but they don't contain info on why the restart is failing. Could you post the output of journalctl -u pac4cli.service
?
-- Logs begin at Sun 2020-02-16 17:39:28 IST, end at Wed 2020-02-19 11:37:43 IST. -- Feb 18 16:48:22 pop-os systemd[1]: Starting PAC autoconfigured proxy for use through http_proxy= environment variables... Feb 18 16:48:23 pop-os pac4cli[7143]: Traceback (most recent call last): Feb 18 16:48:23 pop-os pac4cli[7143]: File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main Feb 18 16:48:23 pop-os pac4cli[7143]: "__main__", mod_spec) Feb 18 16:48:23 pop-os pac4cli[7143]: File "/usr/lib/python3.7/runpy.py", line 85, in _run_code Feb 18 16:48:23 pop-os pac4cli[7143]: exec(code, run_globals) Feb 18 16:48:23 pop-os pac4cli[7143]: File "/usr/local/lib/python3.7/dist-packages/pac4cli/__main__.py", line 3, in <module> Feb 18 16:48:23 pop-os pac4cli[7143]: from twisted.internet import reactor Feb 18 16:48:23 pop-os pac4cli[7143]: ModuleNotFoundError: No module named 'twisted' Feb 18 16:48:23 pop-os systemd[1]: pac4cli.service: Main process exited, code=exited, status=1/FAILURE Feb 18 16:48:23 pop-os systemd[1]: pac4cli.service: Failed with result 'exit-code'. Feb 18 16:48:23 pop-os systemd[1]: Failed to start PAC autoconfigured proxy for use through http_proxy= environment variables. Feb 18 16:48:23 pop-os systemd[1]: pac4cli.service: Service RestartSec=100ms expired, scheduling restart. Feb 18 16:48:23 pop-os systemd[1]: pac4cli.service: Scheduled restart job, restart counter is at 1. Feb 18 16:48:23 pop-os systemd[1]: Stopped PAC autoconfigured proxy for use through http_proxy= environment variables. Feb 18 16:48:23 pop-os systemd[1]: Starting PAC autoconfigured proxy for use through http_proxy= environment variables... Feb 18 16:48:23 pop-os pac4cli[7159]: Traceback (most recent call last): Feb 18 16:48:23 pop-os pac4cli[7159]: File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main Feb 18 16:48:23 pop-os pac4cli[7159]: "__main__", mod_spec) Feb 18 16:48:23 pop-os pac4cli[7159]: File "/usr/lib/python3.7/runpy.py", line 85, in _run_code Feb 18 16:48:23 pop-os pac4cli[7159]: exec(code, run_globals) Feb 18 16:48:23 pop-os pac4cli[7159]: File "/usr/local/lib/python3.7/dist-packages/pac4cli/__main__.py", line 3, in <module> Feb 18 16:48:23 pop-os pac4cli[7159]: from twisted.internet import reactor Feb 18 16:48:23 pop-os pac4cli[7159]: ModuleNotFoundError: No module named 'twisted' Feb 18 16:48:23 pop-os systemd[1]: pac4cli.service: Main process exited, code=exited, status=1/FAILURE Feb 18 16:48:23 pop-os systemd[1]: pac4cli.service: Failed with result 'exit-code'. Feb 18 16:48:23 pop-os systemd[1]: Failed to start PAC autoconfigured proxy for use through http_proxy= environment variables. Feb 18 16:48:23 pop-os systemd[1]: pac4cli.service: Service RestartSec=100ms expired, scheduling restart. Feb 18 16:48:23 pop-os systemd[1]: pac4cli.service: Scheduled restart job, restart counter is at 2. Feb 18 16:48:23 pop-os systemd[1]: Stopped PAC autoconfigured proxy for use through http_proxy= environment variables. Feb 18 16:48:23 pop-os systemd[1]: Starting PAC autoconfigured proxy for use through http_proxy= environment variables...
Looks like it's not finding twisted
. I also tried to run pac4cli manually and it cannot find pacparser. Do I need to install these dependencies manually?
pac4cli Traceback (most recent call last): File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/dist-packages/pac4cli/__main__.py", line 9, in <module> import pacparser ModuleNotFoundError: No module named 'pacparser'
Note that I've successfully run the pip3 install command, and looks like it did contain twisted.
Did you do make install
?
yes.
Okay, so I managed to manually install pacparser using sudo apt install python3-pacparser
. Now when I try to manually run pac4cli this is what I'm getting.
pac4cli Traceback (most recent call last): File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "/usr/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/usr/local/lib/python3.7/dist-packages/pac4cli/pac4cli.py", line 7, in <module> from . import portforward ImportError: attempted relative import with no known parent package
output from journalctl -u pac4cli.service remains same. Any ideas on what might be going on?
Stackoverflow suggests that one reason this might happen is if you are running the script as a script instead of as a module (this link here). I'm not sure if that's the case for you because I see _run_module_as_main
in your stack trace, but just to double-check: are you running it as
python3 -m pac4cli
which is what should be in the shell script
$ cat `which pac4cli`
#!/bin/sh
/usr/bin/python3 -m pac4cli "$@"
?
@Kalyan-M how is it going? Did you manage to get it to work?
I tried to install it again in a fresh install of ubuntu 19.10 and I'm still getting error. Installation:
sudo apt install libsystemd-dev
pip3 install requirements.txt
sudo make install
Mar 04 21:13:15 systemd[1]: Starting PAC autoconfigured proxy for use through http_proxy= environment variables...
Mar 04 21:13:16 pac4cli[2860]: Traceback (most recent call last):
Mar 04 21:13:16 pac4cli[2860]: File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
Mar 04 21:13:16 pac4cli[2860]: "__main__", mod_spec)
Mar 04 21:13:16 pac4cli[2860]: File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
Mar 04 21:13:16 pac4cli[2860]: exec(code, run_globals)
Mar 04 21:13:16 pac4cli[2860]: File "/usr/local/lib/python3.7/dist-packages/pac4cli/__main__.py", line 3, in <module>
Mar 04 21:13:16 pac4cli[2860]: from twisted.internet import reactor
Mar 04 21:13:16 pac4cli[2860]: ModuleNotFoundError: No module named 'twisted'
Mar 04 21:13:16 systemd[1]: pac4cli.service: Main process exited, code=exited, status=1/FAILURE
Mar 04 21:13:16 systemd[1]: pac4cli.service: Failed with result 'exit-code'.
Mar 04 21:13:16 systemd[1]: Failed to start PAC autoconfigured proxy for use through http_proxy= environment variables.
Although, importing twisted and reactor from twisted.internet works from python interactive shell.
By the way, my corporate proxy also requires authentication. Will downloading the pac file, editing the proxy with username:password@proxy.com, and specifying the file location instead of url in the pac4cli.config work?
Although, importing twisted and reactor from twisted.internet works from python interactive shell.
That's so weird. Can you paste the terminal input/output for what's working as well? And can you try whether make check
works?
By the way, my corporate proxy also requires authentication. Will downloading the pac file, editing the proxy with username:password@proxy.com, and specifying the file location instead of url in the pac4cli.config work?
Ayay, no I don't think that's supported at the moment. Let me open an issue for that.
I finally did
sudo apt install python3-pacparser
sudo apt install python3-twisted
sudo apt install python3-service-identity
sudo apt install python3-txdbus
and downloaded and installed
pac4cli_0.1ubuntu2+git119~ubuntu19.04.1_all.deb
python3-systemd-cython_0.9.15+git37~ubuntu18.04.1_amd64.deb
python-systemd-cython_0.9.15+git37~ubuntu18.04.1_amd64.deb
python3-txdbus_1.0.15~git1+git84~ubuntu19.04.1_all.deb
python-txdbus_1.0.15~git1+git84~ubuntu19.04.1_all.deb
from launchpad and it works fine.
Happy to hear! I'm closing this issue, then.
If you have time, maybe you can edit the README with a small paragraph that would have helped you so others don't run into the same issue.