Syncthing returns 2; -noupgrade broken?

I am currently testing 0.12 beta. On my server syncthing terminated this night with exit code 2. syncthing(1) says, that exit code 2 means “Upgrade not available”. Since I am building with -noupgrade there is something wrong I think.

  • Does -noupgrade work with dev builds?
  • Is this a bug, or intended behaviour?
$ systemctl status syncthing@stefan.service
● syncthing@stefan.service - Syncthing - Open Source Continuous File Synchronization for stefan
   Loaded: loaded (/usr/lib/systemd/system/syncthing@.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Thu 2015-10-01 00:01:38 CEST; 10h ago
     Docs: http://docs.syncthing.net/
  Process: 11335 ExecStart=/usr/bin/syncthing -no-browser -logflags=0 (code=exited, status=2)
 Main PID: 11335 (code=exited, status=2)

What did it say before it exited? The only time we intentionally exit with 2 is on an explicit -upgrade, to say that there was nothing to upgrade to.

Nothing strange…

...
Sep 30 23:36:40 coruscant syncthing[11335]: [GDACT] INFO: Starting web GUI on https://0.0.0.0:8384/
Sep 30 23:36:40 coruscant syncthing[11335]: [GDACT] INFO: Device NXFFORR-BPMJIZY-4QLLUIS-T4BYAU3-LBCGNC2-5ZCZ4FL-IN47BLC-F7MFMQ4 is "tatooine" at [tcp://5.9.41.253]
Sep 30 23:36:40 coruscant syncthing[11335]: [GDACT] INFO: Device TYZZZEJ-EZXAHJ7-EQVYGOQ-24MYW4Z-NF4YI6J-CHI6YYM-2CRXPUM-BF3HMQR is "alderaan" at [dynamic]
Sep 30 23:36:40 coruscant syncthing[11335]: [GDACT] INFO: Device 35K664T-JVVJ4MZ-NNISZW6-O4QGUOS-PPDK5VK-VGJKMEB-A2XXOI4-6Z3ZIAV is "kronos" at [dynamic]
Sep 30 23:36:40 coruscant syncthing[11335]: [GDACT] INFO: Device E3RN6YY-FVSTHS4-23RCI2E-H6GDCA2-KZTA44V-A5USAQ6-K7QLCC7-YOGYSQU is "marta-win" at [dynamic]
Sep 30 23:36:40 coruscant syncthing[11335]: [GDACT] INFO: Device GDACTPT-HASVGSG-BVKYKA2-AVHRWHN-TNOQ7IG-HSCGH43-G5FT4V7-RD2T5QU is "coruscant" at [dynamic]
Sep 30 23:36:40 coruscant syncthing[11335]: [GDACT] INFO: Device LFKUKZW-S3MG7WS-CXHK3US-R4PCZEI-HIGOUMA-BBDOEEY-5H24LDC-7ZWUIQW is "naboo" at [dynamic]
Sep 30 23:36:40 coruscant syncthing[11335]: [GDACT] INFO: API listening on [::]:8384
Sep 30 23:36:40 coruscant syncthing[11335]: [GDACT] INFO: Starting usage reporting
Sep 30 23:36:41 coruscant syncthing[11335]: [GDACT] INFO: Completed initial scan (rw) of folder dokumente
Sep 30 23:36:55 coruscant syncthing[11335]: [GDACT] INFO: Established secure connection to 35K664T-JVVJ4MZ-NNISZW6-O4QGUOS-PPDK5VK-VGJKMEB-A2XXOI4-6Z3ZIAV at XXX.XXX.XXX.XXX:51940-XXX.XXX.XXX.XXX:443 (relay-dial)
Sep 30 23:37:08 coruscant syncthing[11335]: [GDACT] INFO: Established secure connection to LFKUKZW-S3MG7WS-CXHK3US-R4PCZEI-HIGOUMA-BBDOEEY-5H24LDC-7ZWUIQW at XXX.XXX.XXX.XXX:51951-XXX.XXX.XXX.XXX:443 (relay-dial)
Sep 30 23:37:08 coruscant syncthing[11335]: [GDACT] INFO: Device LFKUKZW-S3MG7WS-CXHK3US-R4PCZEI-HIGOUMA-BBDOEEY-5H24LDC-7ZWUIQW client is "syncthing v0.12.0-beta2+10-g375c9dd"
Sep 30 23:37:08 coruscant syncthing[11335]: [GDACT] INFO: Device LFKUKZW-S3MG7WS-CXHK3US-R4PCZEI-HIGOUMA-BBDOEEY-5H24LDC-7ZWUIQW name is "naboo"
Sep 30 23:37:49 coruscant syncthing[11335]: [GDACT] INFO: Connection to LFKUKZW-S3MG7WS-CXHK3US-R4PCZEI-HIGOUMA-BBDOEEY-5H24LDC-7ZWUIQW closed: switching connections
Sep 30 23:39:08 coruscant syncthing[11335]: [GDACT] INFO: Connection to 35K664T-JVVJ4MZ-NNISZW6-O4QGUOS-PPDK5VK-VGJKMEB-A2XXOI4-6Z3ZIAV closed: EOF
Sep 30 23:44:38 coruscant syncthing[11335]: [GDACT] INFO: Connection to LFKUKZW-S3MG7WS-CXHK3US-R4PCZEI-HIGOUMA-BBDOEEY-5H24LDC-7ZWUIQW closed: read timeout
Oct 01 10:24:24 coruscant systemd[1]: Stopped Syncthing - Open Source Continuous File Synchronization for stefan.
Oct 01 10:24:24 coruscant systemd[1]: Started Syncthing - Open Source Continuous File Synchronization for stefan.

I’m guessing it crashed… It looks like an unhandled panic or fatal error gets us an exit 2 from the runtime. If it had, would you have had data from stderr also in that log?

(Perhaps we should redefine our exits based on that… We’ll “leak” that exit code when we’re running with STNOMONITOR, otherwise we handle it internally.)

Just checked the docs, systemd.exec(5):

 StandardError=
       Controls where file descriptor 2 (STDERR) of the executed processes
       is connected to. The available options are identical to those of
       StandardOutput=, with one exception: if set to inherit the file
       descriptor used for standard output is duplicated for standard
       error. This setting defaults to the value set with
       DefaultStandardError= in systemd-system.conf(5), which defaults to
       inherit.

As it is set to inherit on my box, the logs should be there.

¯\(ツ)

Could it be that kind of SIGTERM problem?

Do we not have a sigterm handled in syncthing?

Nope. So yeah, it’s probably that.

1 Like

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