nanos / FediFetcher

FediFetcher is a tool for Mastodon that automatically fetches missing replies and posts from other fediverse instances, and adds them to your own Mastodon instance.
https://blog.thms.uk/fedifetcher?utm_source=github
MIT License
309 stars 230 forks source link

Exit code 127 with on-fail specified #46

Closed lnlyssg closed 1 year ago

lnlyssg commented 1 year ago

I added ON_FAIL and ON_DONE environment variables to my Actions but now I'm getting an error with "command not found", it seems that on-start also needs to be specified? It's also highlighting an issue with max-bookmarks too (note that the URLs have been redacted):

Run python find_posts.py --lock-hours=0 --access-token=*** --server=social.racf.guru --reply-interval-in-hours=0 --home-timeline-length=200 --max-followings=80 --user= --max-followers=0  --http-timeout=5 --max-follow-requests=0 --on-fail=https://uptime.zzz/api/push/xxxxxx?status=down&msg=Failed%20Run&ping= --on-start= --on-done=https://uptime.zzz/api/push/xxxxxx?status=ok&msg=OK&ping= --max-bookmarks=0 --remember-users-for-hours=168 --from-notifications=1 --backfill-with-context=1  --backfill-mentioned-users=1  --max-favourites=0
/home/runner/work/_temp/23caf967-1fa7-49dd-965b-7234c27c4927.sh: line 1: --on-start=: command not found
/home/runner/work/_temp/23caf967-1fa7-49dd-965b-7234c27c4927.sh: line 1: --max-bookmarks=0: command not found
Error: Process completed with exit code 127.
nanos commented 1 year ago

That had me stumped for a while, until I realised that the bug isn't produced by FediFetcher at all, instead it's caused by your bash script.

The reason being the & sign, which your bash interprets as starting a new command called --on-start=:, which obviously doesn't exist.

You should wrap your callback URLs in quotes:

find_posts.py --on-fail="https://uptime.zzz/api/push/xxxxxx?status=down&msg=Failed%20Run&ping="
nanos commented 1 year ago

D'oh, sorry. I didn't see you were using an Action. I will attempt to fix this

nanos commented 1 year ago

Can you update your fork and try again please? Please let me know if that fixes it.

lnlyssg commented 1 year ago

That looks better, thanks for the quick fix!

nanos commented 1 year ago

Thanks for the confirmation!