jhuckaby / performa-satellite

Remote data collector for Performa.
Other
15 stars 2 forks source link

Suffix in performa-satellite cron file preventing launch #5

Closed awbarbeau closed 3 months ago

awbarbeau commented 3 months ago

Describe the bug

The file suffix (.cron), or possibly the ., in the performa-satellite cron file (performa-satellite.cron) appears to be preventing launch of cron job, blocking telemetry being sent on a schedule to Performa main server.

To Reproduce

Install performa-satellite 1.1.4, update config.json to valid host/secret_key/protooptions. Run performa-satellite --debug or performa-satellite --fake to validate that satellite can communicate with master server. Wait 1-65 seconds until cron schedule and sleep cycle have run. Observe no new metrics on master server for satellite.

Expected behavior

performa-satellite binary executes once per minute via cron.

Example resolution

After validating that running /opt/performa/satellite.bin lead to metrics being reported to master server, ran this shell command to create a cron file without a "." in the name: cp /etc/cron.d/performa-satellite.cron /etc/cron.d/performa-satellite Metrics were received by master server after this new cron file was created.

Priority

P2, local resolution is straightforward Reference - Google Issue tracker priority levels

Screenshots/Video

If applicable, add screenshots/video to help explain your problem. Remember to mark the area in the application thats impacted.

Example of issue and resolution

Environment

Observed on performa-satellite on below 2 environments

Operating System: Debian GNU/Linux 12 (bookworm) 12.2.0-14 Kernel: Linux 6.8.8-2-pve Architecture: x86-64 Binary: performa-satellite-linux-x64 Virtualization: lxc Protocol: https

Operating System: DietPi 9.5.1 Kernel: Linux 6.1.21-v8+ Architecture: aarch64 Binary: performa-satellite-linux-arm64 Device: RPi Zero 2 W (aarch64) Protocol: https

Additional context

I'm assuming the name of the cron file has been tested by many others, so not clear to me if the issue is stemming from my use of Debian, DietPi, or some setting I haven't updated in cron.

Relevant code appears to be the below line, however not sure on what sort of environment checks would determine when an alternate form would work so not raising a PR with just the change described in the example resolution https://github.com/jhuckaby/performa-satellite/blob/849adf5da70ec0ff5d1a89566a4e1a5f0e226b56/index.js#L43

Based on what I think is the relevant man page, I would expect this structure to have not worked in Debian versions where dots are not allowed in cron file names.

jhuckaby commented 3 months ago

Thank you so much for this detailed issue report. This has been fixed in v1.1.5.