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

Data Integrity check fails when using an absolute path #217

Closed
3urobeat opened this issue Nov 7, 2023 Discussed in #216 · 2 comments
Closed

Data Integrity check fails when using an absolute path #217

3urobeat opened this issue Nov 7, 2023 Discussed in #216 · 2 comments
Labels
Bug Something isn't working and the problem is in the code Fixed The issue is now fixed

Comments

@3urobeat
Copy link
Owner

3urobeat commented Nov 7, 2023

Discussed in #216

Originally posted by casper-none November 6, 2023
Can I run this script on Ubuntu?
I made systemd so that the script runs in the background but I get this error
image
This is what the file looks like

[Unit]
Description=Comment Bot
After=network.target

[Service]
ExecStart=/usr/bin/node /home/comms/commentbot/start.js
Restart=on-success
RestartSec=5s

[Install]
WantedBy=multi-user.target

 

After further investigation it seems like the data integrity check uses relative paths from the current location of the terminal; which is of course incorrect when using an absolute path.

@3urobeat 3urobeat added the Bug Something isn't working and the problem is in the code label Nov 7, 2023
@3urobeat
Copy link
Owner Author

3urobeat commented Nov 7, 2023

Found a workaround for now - simply define a WorkingDirectory should you also use a systemd service file.
The file from above should look like this:

[Unit]
Description=Comment Bot
After=network.target

[Service]
WorkingDirectory=/home/comms/commentbot
ExecStart=/usr/bin/node start.js
Restart=on-success
RestartSec=5s

[Install]
WantedBy=multi-user.target

If you were trying to start directly from a terminal using an absolute path, please make sure you cd into the bot's folder first and then use a relative path like node ./start.js.

@3urobeat
Copy link
Owner Author

Version 2.14.1 is out on the master branch which fixes this issue.

@3urobeat 3urobeat added the Fixed The issue is now fixed label Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working and the problem is in the code Fixed The issue is now fixed
Projects
No open projects
Development

No branches or pull requests

1 participant