We are getting network not allowed on the gui - I noticed a few things - we do not have the allowedNetworks defined (but the default config does not either). Also the config documentation does not show this as an array of String(which I assume it is) it shows a simple String object but when I use the api - it returns an empty array (even if it is not defined in the config - which I assume is the proper type)
Sorry, but I have no idea what you are talking about.
What’s the problem you are seeing/or trying to solve? Do you have screenshots or something?
I cannot share the screen shots so let me see if I can clarify. We are using the post config to update the configuration and adding a device. This all seems to work. so we check the insync flag to see if we need a reboot. if so - we reboot - and it shows in the log. we then open the GUI to verify all was OK (device was added) and when you view the device it says network not allowed. if we reboot in the GUI - the problem seems to go away. Before we included the reboot - we would get the message that we were out of sync (so I assume the reboot solved this issue)
Sorry, but still not clear what “shows in the log”, or where it says “network not allowed”. Also, I assume by reboot you mean restart of the application, or reboot of the machine?
OK - the “network not allowed” shows in the GUI under the device we added. We have used the POST restart to restart syncthing - I refer to the log - which verifies the POST restart did, in fact, work.
That error means the device is connecting from a network it’s not allowed to connect from, so the connection is dropped.
we have no disallowed networks
the allowedNetworks is not even present in the config
Could this be caused by certificate issues?
Well, that device must have some entry in “allowedNetworks” for syncthing to give that error.
You should check the raw config file perhaps.
I can’t see how this could be related to certificates.
OK - checked the raw xml - nothing in any device (or the file as a whole) however when I ignore the insync flag and reboot regardless of the state it works fine. So the issue seems to be the insync flag either takes time to update - or does not catch all the changes that require a reboot.
Do you have a way to reproduce this?
Also, the “network not allowed” I assume shows up as a log message why connection was rejected in the logs? Not in the UI?
no - no errors in the log - first place I checked. I cannot share the code as it is on a restricted system. Bu what we are doing is programmatically adding a device, so we create a new config by reading the old one with the api and inserting the new device. (We use Java so it is a class (or series of classes actually)), then we post it back out using the POST config in the api. The raw xml looks fine. We do a single update to the config and then use the insync flag to verify the instance in memory is the same as on the disk.
Then we use the GUI to verify the change was OK. The issues appear on a second add - insync does not seem to reflect the need for a reboot. First time is OK second time it is incorrect.
I suspect strongly the could be duplicated by simply doing one update followed by a second one in code with a check for restart in each config update
So adding a device does not require a restart, so I suspect your java code is serializing something incorrectly which then gets cleaned up after a restart by code that cleans the config after restart.
I can’t see a place where/how this error could show up in the UI, as the only place where this error is used is in a function who’s output is logged to the logs, nowhere else.
This would imply the the api is also updating the “in memory” copy as well as the “on disk” copy. Something that we cannot see.
Would adding a folder require a restart?
Or rather updating - as we add the device to the folder as well.
so the java datatype for the allowedNetworks would be a String array?