plesk / plesk/kb-scripts

cf-nginx-ip-passthrough script fails randomly

Open
#67 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
8
Forks
22
PR merge metrics
No merged PRs in 30d

Description

I have a scheduled task which fetches and runs the cf-nginx-ip-passthrough (cf.sh) script periodically. It seems to fail at random, disabling the cloudflare.conf file and touching cf-stop. I believe this is caused by an occasional network hiccup but I can't be sure, and it highlights three problems:

  1. The script always returns 0 so the Plesk setting to notify on error doesn't work.
  2. If I enable notifications for every run, the emails only contain the cURL output and Configuration applied. Restarting Nginx. On and after the fatal failure, I only receive the cURL output in the emails, so I can't be certain what going wrong.
  3. Oddly, the .disabled file is always valid when I log in to intervene (I rename it back to cloudflare.conf and nginx -t succeeds), so I wonder if the code to rollback to the previous working config is broken.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the cf.sh script and reproduce its scheduled execution while inspecting the cURL output, cloudflare.conf, and cf-stop behavior. Check the rollback path with nginx -t and determine what happens during an intermittent network failure. Done means failures return a nonzero status, notifications include the relevant error, and a valid previous configuration is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.