-
Notifications
You must be signed in to change notification settings - Fork 433
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
Poetry module not found by systemd services #2408
Comments
I'm getting the same exact issue and the suggested PR lets me progress further. Still stuck afterwards due to the cape2.sh installer failing to find poetry anyways despite the fixed issue 2400. |
@poland4000 Can you share the portion of
|
I'd like to provide a log though I already 'fixed' it by including the poetry path into secure_path in visudo. Without this It would install just as in your logs, poetry installation would be successful however every step involving poetry e.g. "poetry --directory /opt/CAPEv2/ run pip install yara-x" would throw poetry command not found. I used "sudo ./cape2.sh all cape | tee cape.log" to install. |
So, with the base install that I ran, I did not hit those errors. I have a feeling May simply be that the spots where the first command is used need to be updated to prepend |
So I got around this by modifying the |
Hey thanks for heads, I will fix systemd tomorrow, files are in systemd
folder inside of CAPEv2, CAPEv2.sh just copies them
El vie, 22 nov 2024, 23:30, czechmate247 ***@***.***>
escribió:
… So I got around this by modifying the ExecStart=/usr/bin/python3 -m
poetry ... part of each cape.*.service file with
ExecStart=/etc/poetry/bin/poetry. The problem is that the cape2.sh script
doesn't install poetry as a module to the base system's pip repo so the
systemd service files ultimately can't find it. I haven't investigated
which part of the cape2.sh install script creates the service files but
it seems like if my changes above were put into the service file templates,
all will work as intended. I don't know if this will have any unintended
side effects but it is working for me so far.
—
Reply to this email directly, view it on GitHub
<#2408 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOFH36RS4HAQWDRIHQQQ7D2B6V7XAVCNFSM6AAAAABSIIFO4GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJUHE3TQNJYGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
fixed here a8c6b37 |
@doomedraven From the fix commit in
Should these two lines be this instead?
|
ah yes good catch, thanks, fixing |
@doomedraven As always, thank you for all your work! I'll close out this issue and the PR I put up. There may remain the problem others are reporting here with the cape2.sh script failing to find Poetry. I don't think that necessarily should be solved in this ticket, though. When I have more time, I will take a look there as well. |
thanks for the headups, the poetry now is instaled to /etc/poetry so shouldn't be a problem anymore, let me know if you find any other problem |
About accounts on capesandbox.com
This is open source and you are getting free support so be friendly!
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
After full install, CAPE's systemd services should be active.
Current Behavior
Services all fail to activate.
Failure Information (for bugs)
Cape, cape-web, cape-rooter, and cape-processor services fail to activate. Errors indicate poetry not being found by python correctly.
Steps to Reproduce
poetry install
systemctl status
and/orjournalctl -u <service> -f
. Will display failure info.Context
Installed on a bare metal server with Ubuntu 22.04.
Recent changes to the method of installing poetry in cape2.sh (
curl -sSL https://install.python-poetry.org | POETRY_HOME=/etc/poetry python3 -
) move where it is installed to/etc/poetry
. No issue with installing that way or in that location because that is exactly how poetry's docs say it can be done.I believe this new install location is not a location that python will check when attempting to load a module with
python -m
. The previous use ofapt install python-poetry
was likely installing at/usr/local/lib/python3.10/dist-packages
or/usr/lib/python3/dist-packages
. Directly runningsudo -u cape poetry run python3 cuckoo.py
from/opt/CAPEv2
works properly. Nearly positive this issue is isolated to the systemd service files.PR with proposed fix here: #2407
I am not entirely sure about the ramifications of running the
ExecStart
s with/etc/poetry/bin/poetry run python ...
instead of/usr/bin/python3 poetry run python ...
, but the changes in this PR fix the problem for me.Leaving it as a draft until anyone else can confirm that
Failure Logs
From the
journalctl
for cape.service.Note that
poetry
is available in the PATH variable.The text was updated successfully, but these errors were encountered: