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

System Commands periodically get deleted #5

Open
jminardi opened this issue Apr 22, 2016 · 46 comments
Open

System Commands periodically get deleted #5

jminardi opened this issue Apr 22, 2016 · 46 comments
Labels

Comments

@jminardi
Copy link

Every once in a while all system commands get deleted.

I suspect this happens when the request to get the current system commands from octoprint hangs, and the user clicks save before any are loaded. This causes the system command editor plugin to save the now empty list of system commands, overwriting everything. This is just a suspicion based on the fact that I sometimes see the system commands take 10+ seconds to be listed in the plugin.

Let me know if there is anything I can do to help debug/fix this issue.

A quick workaround would be to implment a confirmation dialog any time all system commands are deleted.

@Salandora
Copy link
Owner

Uhm never had such a problem.
Sounds weird, but possible.
I try to investigate this when I have a little bit more time.

@jminardi
Copy link
Author

Is there anything I can do to help debug? We have about 15 machines running this now and we probably see the issue on one machine a week.

@Salandora
Copy link
Owner

Salandora commented Apr 25, 2016

Well you could check what gets transmitted on a Save click while the settings haven't been fully loaded.

EDIT: on a short check I guess you could be right with your assumption. I guess the settings part needs a little refactoring on my side.

@Salandora Salandora added the bug label Apr 25, 2016
@morthimor
Copy link

I know it is pretty much two years ago, but I just started, and where I love this plugin settings are still not saving. Actually these are saved, but then after page refresh are wiped.

@fchansa
Copy link

fchansa commented Feb 6, 2018

Same here ... can save (working) system commands ... after refresh they are gone :-(
(Love this plugin ... the only chance to shut down my printer after a job with my TPLink HS100.)

@4RnrRick
Copy link

I'm also having this issue with my commands getting deleted.
Hardware is a Raspberry Pi 3, RPi Ver1 Camera with Octoprint 1.3.6 connected to my network via WiFi, with the following additional plugins:
CR-10 Leveling (2.0.0)
Detailed Progress (0.1.4)
FullScreen (0.0.4)
PortLister (0.1.7)
System Command Editor (0.3.1)
TP-Link Smartplug (0.9.3)
WebCam Tab (0.1.2)

The two commands I want are "sudo service webcamd start" and "sudo service webcamd stop". As for TP-Link, I have two WiFi plugs, one for the printer(CR-10s) and one for a LED light bar. I have also tried using a Raspberry Pi 2 and/or a IR Nightvision Pi Camera without success. After I add the commands into plug-in interface, I can terminal into the Pi and they are added to the ~/.octoprint/config.yaml file, but typically on restart of the device, they will be deleted or the file gets reverted back to stock configuration. really annoying.

@4RnrRick
Copy link

Here is what i discovered, every time I click Save in the SystemCommandEditor interface after writing commands, it updates ~/.octoprint/config.yaml. But when I restart OctoPrint either from a terminal or OctoPrint Menu, during boot up it rewrites the config.yaml back to a factory default and time stamps it with the last bootup of octoprint without the new user entered commands. this also happens when you do a shutdown and fire it back up from scratch.

@Salandora
Copy link
Owner

O.o that sounds strange.

@4RnrRick what you're describing sound like a completely different bug.
@foosel do you know any recent changes to the OctoPrint Core which could cause the problem of @4RnrRick?

To behonest I completely forgot about the initial bug -.-

@foosel
Copy link
Contributor

foosel commented Mar 23, 2018

@Salandora not really recent. But a long long time ago (in a galaxy far away) the restart/shutdown commands became something special and there's migration code in there that will extract those from the system commands if detected. That shouldn't touch any other defined system commands however.

Log files might help. I also think I made it create a backup in such a migration case (config.system_command_migration.yaml in the same folder), so that would allow debugging this further if it's indeed caused by that migration.

@DrMarlin
Copy link

I can confirm the same symptom/problem @4RnrRick has reported. I created commands and they work/behave correctly. Once Octoprint restarts (e.g. choosing to restart from the menu), the commands disappear/are removed from the config.yaml.

@blebson
Copy link

blebson commented Jun 19, 2018

I can confirm that I am still seeing this issue.

@MathijsG
Copy link

Having the same issue all the time. Quite annoying :(.

@alokbhargava52
Copy link

alokbhargava52 commented Jul 29, 2018

I do face the same issue. Commands disappear after refresh on the browser or on re-loading.

I use mac pro and Pi 3 B+

@akurz42
Copy link

akurz42 commented Aug 4, 2018

And the same here...

@MathijsG
Copy link

MathijsG commented Oct 2, 2018

This happend thrice in a row here last week. Any updates on this?

@Salandora
Copy link
Owner

Salandora commented Oct 4, 2018

@MathijsG do you use the TPLinkSmartplug plugin?
Also which of both bugs appead to you?

the one @jminardi mentioned or the one @morthimor, @fchansa and @4RnrRick mentioned.

@MathijsG
Copy link

MathijsG commented Oct 5, 2018

@Salandora No I'm not using that plugin. I'm using Domoticz with an RFLink and a 433 Mhz switch, but that doesn't matter, I only use an HTTP URL with it via CURL. Which works, until it somehow randomly is away again.

@ermockler
Copy link

I am getting this issue as well. When I restart OctoPrint the commands I added are gone and I have to add them again.

@ermockler
Copy link

I lost them 4 times, I just put them in again & restarted by sudo /etc/init.d/octoprint stop & then start.
Now it seems to be staying, restarted again from web iface 4x and its still there.
Maybe that helps you figure it out.

@juanillo62gm
Copy link

Same here, plugin still deleting my commands ;(

@RiRilot
Copy link

RiRilot commented Mar 7, 2019

Same here. Any commands I set up will disappear after a while.

@LTrainExpress
Copy link

Also would like to report the same issue.

@DarkDynamite
Copy link

Any updates to that issue?

@zebons
Copy link

zebons commented Jun 18, 2019

Same issue here, System commands loosen periodically. I used also Tasmota plugin and each time I use the Tastmota UI button, System commands are loosen.
I found an alternative solution by disabling the System Commands Editor plugin at once I have created my commands.
Now my commands don't disappear anymore !

@lvillanne
Copy link

Same problem here.
The configuration of the plugin is often overridden by "system: {}" in config.yaml when an other plugin write in this file.
In my case, it's when "bed visualizer" plugin write the mesh data.

@jxlarrea
Copy link

@lvillanne exactly what I'm experiencing. After running Bed Visualizer everything created in System Commands is gone.

@grantpeterwilliamson
Copy link

do de do... same issue here, seems to be any time octoprint restarts or i use the bolt icon to power on or off my printer using MQTT tasmota plugin by @jneilliii

@jneilliii
Copy link
Contributor

I've been testing this relative to my plugins and the system commands being entered in config.yaml without the System Command Editor plugin installed/enabled and I have not been able to recreate the issue. The system commands I have entered have been persistent and are not disappearing. Of course, I don't think @Salandora is actively developing anymore, so maybe if you try using the plugin to configure your system commands, disable the plugin, and then restart OctoPrint.

@Salandora
Copy link
Owner

@jneilliii well actually I'm about to "try" a restart on my plugins.
This will also include a complete rewrite of the system controls and custom controls editors backends.

I'm aware of a few bugs and I think I can get around those bugs with a better more reliable backend implementation.

So if I'm not loosing interest again expect a partial rewrite of this plugin and the custom controls editor plugin.

@Salandora
Copy link
Owner

Alright I just released a pre-release v0.4.0 in there both bugs should be removed.
Maybe someone wants to test it and report back here?

Easiest way to install the pre-release (at least in my opinion) is by installing it through octoprints plugin manager.
Plugin Manager -> Get more -> ... from URL
https://github.com/Salandora/OctoPrint-SystemCommandEditor/archive/pre-0.4.0.zip
Install -> Restart OctoPrint -> Enjoy

@grantpeterwilliamson
Copy link

Oh awesome, will cheak it out later tonight and report back, thanks salandora!

@jneilliii
Copy link
Contributor

I wouldn't @grantpeterwilliamson that release isn't quite ready... I've done extensive testing.

@jabend
Copy link

jabend commented May 31, 2020

I was also experiencing the issue with commands being lost which I attributed to shutdown/restart actions.

For my use-cases, the issues with lost commands have been resolved with pre-0.4.0


While I have not done extensive testing, here is what I did and tested...

  • Deleted my previous install os the SystemCommendEditor
  • Installed the pre-0.4.0 version from URL
  • Re-added system commands and verified commands worked from WebUI and MobileApp
  • Performed various Restart/Shutdown/Bed Visualizer actions

The commands were not lost after:

  • Octopi reboot
  • Bed Visualizer mesh reload
  • Octopi shutdown and restart

@jneilliii
Copy link
Contributor

@jabend can you edit a command now? That was broke prior when I was testing.

@Salandora
Copy link
Owner

Editing is still a problem, I haven'T pushed my fixes yet, because I'm actually moving places and it is more time consuming then I would like to acknowledge so I haven'T done anything on the plugins last few weeks.
Maybe I can push my actual state at the weekend and make a second pre-release for you guys to test.

@BNWEIN
Copy link

BNWEIN commented Nov 16, 2020

This issue still exists. Do we think there will be an update anytime soon that resolves it?

@Bob90
Copy link

Bob90 commented Dec 28, 2020

Just want to add my desire for the revamp. Hope the move went well during COVID.

@lmcbmai
Copy link

lmcbmai commented May 28, 2021

Just experienced the issue. Is anyone looking into this ?

@lmcbmai
Copy link

lmcbmai commented May 29, 2021

I put together a script that backs up and restores lost entries from config.yaml
Use at your own risk. No warranty whatsoever.
The file is attached. Tested and works with plugin version 0.3.4
sce.zip

@jneilliii
Copy link
Contributor

@lmcbmai it seems that the pre-release version linked prior has worked for fixing the issue for some.

@lmcbmai
Copy link

lmcbmai commented May 29, 2021

@jneilliii There was one report of the issue still being present after posting pre-release link, so I was not sure...
Anyway, it was a good chance for me to learn Python :)
Thanks

@jjanes0918
Copy link

Still have the issue was going to try @lmcbmai back up util

@alphatrianguli
Copy link

This is also still an issue, too bad this is not fixed :(

@timur-tabi
Copy link

I upgraded to 0.4.0 and I still have this problem.

@alphatrianguli
Copy link

Unfortunately, the plug-in has become completely unusable for me. Uninstalling now...

@synman
Copy link

synman commented Nov 21, 2022

apologies for being so late to the party.... I have a functional version of this plugin (based on the master branch) here: https://github.com/synman/OctoPrint-SystemCommandEditor/archive/refs/heads/master.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests