I have Ignition 7.9.3 running in a docker container. I was attempting to create a script to backup the gateway, but the gwcmd does not appear to work.
gwcmd -b test.gwbk gives the following error:
Error! No response from Gateway, backup could not be retrieved.
All the other gwcmd commands work, including
-r to restart and
-i to get info about the gateway status. But for some reason the backup doesn’t work.
Nothing is added to the wrapper.log or any other log file that I am aware of.
Does anyone have any suggestions what might be the issue here? In this container the gateway runs on port 80. Does anyone know if the gwcmd works properly with a non-standard gateway port?
How did you set up your docker container?
gwcmd needs to be above the ‘data’ directory of your Ignition install - the response it’s waiting for is literally a binary file called
response that will be automatically generated in that directory. I just tested on a 7.9.3 docker instance where the entire contents of a zip install are in
/usr/local/bin/ignition and I was able to obtain the .gwbk fine.
Aha! If I run it from /var/lib/ignition then it works.
I don’t quite understand this. Looking at the gwcmd script, it appears to pass dataDir=/var/lib/ignition/data, so the HeadlessControlUtil should know where the datadir is. Why do I also have to cd to that directory?
Hmm. If i run it from /var/lib/ignition but say “gwcmd -b /foo.gwbk” then I get the same error.
If I run it with a random working directory but say “gwcmd -b /var/lib/ignition/temp/foo.gwbk” then it works.
I am wondering if this is some sort of permissions problem, but the error is not being reported properly? This is slightly odd though, because Ignition is actually running as root.
After running in circles with inconsistent results, I finally discovered that gwcmd has a timeout of 10 seconds. My project is large enough that the gateway takes about 10 seconds to export the backup file, so it would often (but annoyingly not always!) time out and give up, which is what the “No response from gateway” message means.
I cannot see any way to increase this timeout. For gateways with large or many projects this timeout is far too short. We really need a way to change the timeout setting, or else send progress messages to gwcmd while the gateway is exporting so it knows to keep waiting.
For what it’s worth, we do have an internal ticket right now to increase the GCU/gwcmd timeout. I don’t have a timeline on when it will be implemented though.
Has that been implemented?
I’ve got 5 machine to make automatic backup in the same condition.