Repository: syncthing/syncthing (language: go)

Issue:
Syncthing Docker container fails to start if underlying filesystem doesn't support `chown`
### Does your log mention database corruption?

No

### Include required information

Please be sure to include at least:

Syncthing fails to start if its unable to `chown` the `/var/syncthing` docker volume. The mount providing the folder does not allow that. I think syncthing should still be able to start.

log says: `chown: /var/syncthing: Invalid argument`


Discussion / hints:

Fix patch:
diff --git a/script/docker-entrypoint.sh b/script/docker-entrypoint.sh
index e93e56306b0..af87ef80b6a 100755
--- a/script/docker-entrypoint.sh
+++ b/script/docker-entrypoint.sh
@@ -14,8 +14,10 @@ if [ "$(id -u)" = '0' ]; then
     setcap "$PCAP" "$binary"
   fi
 
-  chown "${PUID}:${PGID}" "${HOME}" \
-    && exec su-exec "${PUID}:${PGID}" \
+  # Chown may fail, which may cause us to be unable to start; but maybe
+  # it'll work anyway, so we let the error slide.
+  chown "${PUID}:${PGID}" "${HOME}" || true
+  exec su-exec "${PUID}:${PGID}" \
        env HOME="$HOME" "$@"
 else
   exec "$@"


Test patch: