whitesoup12 / remote-falcon

Remote Falcon Monorepo for all things RF
GNU General Public License v3.0
12 stars 5 forks source link

Managed PSA Off causes FPPD Crash #137

Closed Jchuchla closed 8 months ago

Jchuchla commented 9 months ago

Your Show Name: Chuchla Family Lights

Describe the bug: I just today started using the managed PSA functionality. I run a semi-static sequence all night. This is a simple 1 minute single sequence playlist that loops over and over all night. I didn't want the PSA sequence to come on every 3 minutes. So I added the Managed PSA on and off commands to my playlist(s). On the next schedule change (at midnight), FPPD crashed. The following is logged in the fppd.log.

2023-12-11 00:01:01.447 (29497) [Plugin] /opt/fpp/src/Plugins.cpp:281: We failed to exec our command callback: Permission denied 2023-12-11 00:01:01.448 (29497) [Plugin] /opt/fpp/src/Plugins.cpp:283: /home/fpp/media/plugins/remote-falcon/commands//managed_psa_off.php 2023-12-11 00:01:01.448 (29497) [Plugin] /opt/fpp/src/Plugins.cpp:283: (null) 2023-12-11 00:12:38.671 (1911) [General] /opt/fpp/src/fppd.cpp:265: Crash handler called: 7 2023-12-11 00:12:38.671 (29497) [General] /opt/fpp/src/fppd.cpp:265: Crash handler called: 7

Recovery steps Because this playlist was the one that was supposed to be playing at the current moment, it was tricky to recover. I had no control from FPPs web gui. I first had to use the command line to hand edit the json in the playlist file to delete the Managed PSA Off command.
Then I rebooted the pi and the playlist started as it should.

Jchuchla commented 9 months ago

I should also add that Managed PSA should have already been off when it called the command to turn it off. Though I'm not sure how to verify what state it was in when the crash occurred. I'm not sure if issuing the off command when it was already off was part of the problem.

Jchuchla commented 9 months ago

Had one of those laying in bed aha moments. I found the issue to be with incorrect permissions on two scripts in plugin folder. "managed_psa_off.php" and "managed_psa_on.php" were set to 644 permissions. I noticed the rest of the scripts in that folder that corresponded with RF commands had permissions of 755. I changed the permissions on these two scripts to 755 and they started working from the command preset page. I will test the command functionality in the playlists tonight during showtime.

Jchuchla commented 9 months ago

My preshow playlist is working so far without crashes. It includes the Managed PSA Off command. I'm betting that my manual permission changes have solved the crash. The better question is how did they get incorrect permissions in the first place. These were the only two PHP scripts in the RF plugin folder with the 644 permissions. Everything else had 755.

whitesoup12 commented 8 months ago

The file permissions should be fixed now in 1.0.6.