API and --no-browser

This is more of a confirmation topic.

I’m running into issues with accessing Syncthing’s API while it was running as systemd. I would consistently get a CSRF Error. It was driving me nuts.

I could end the systemd and start syncthing up manually and I had instant access with the appropriate api key. But, as soon as I turned on the systemd, again with the appropriate api key, I returned to getting CSRF for any POST or GET requests via curl.

I noticed that the systemd service file is starting syncthing with a --no-browser option. I know that syncthing uses the API for the GUI data connection. So, I edited the service file, removed --no-browser, and started it again. It worked like a charm.

Is this expected behavior? I’ve looked through the documentation, but I’m not seeing anything that says that the API is disabled when the --no-browser startup option is used.

No this is a red herring. -no-browser has no influence on the api, that’s nothing more than the name indicates: Do not open a browser after startup.

Thank you sir, you gave me another avenue to examine and I found the problem. For some reason there were multiple syncthing processes going. I’m not sure how it happened, but once I killed off all of the processes and restarted the systemd, it worked.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.