SFTPGo fails to start: "could not start SFTP server: open id_rsa: read-only file system"
-
Hi,
SFTPGo 2.7.6 fails to start on my Cloudron instance because it cannot create its SSH host key. The app restarts in a loop and the healthcheck never passes.
Environment
- Cloudron version: 10.0.5
- SFTPGo package version: com.sftpgo.cloudronapp@1.4.5
Logs
No host keys configured and "id_rsa" does not exist; try to create a new host key
error creating host key "id_rsa": open id_rsa: read-only file system
could not start SFTP server: open id_rsa: read-only file system
Healthcheck error: AbortError: The operation was abortedThe log shows
HostKeys:[]in the SFTP config andconfig dir: .. SFTPGo therefore tries to writeid_rsainto its working directory, which is on the read-only filesystem (/app/code). The failure is retried every minute (restart loop).Everything else initializes fine: PostgreSQL migration (schema v33), SMTP, OIDC, HTTP on 8080 and WebDAV on 8888.
Workaround
Setting the host keys explicitly to a writable location fixed it for me. In /app/data/sftpgo.json:"sftpd": {
"bindings": [{"port": 2022}],
"host_keys": ["/app/data/id_rsa", "/app/data/id_ecdsa", "/app/data/id_ed25519"]
} -
-
Hello @valexico
I could not reproduce this with a fresh @sftpgo installation.No host keys configured
By default, the @sftpgo app always generates the
/app/data/sftpgo_host_keyand automatically configures the/app/data/sftpgo.jsonfile.
Only when the app is started without theSFTPdport the config file does not automatically configure the'.sftpd.host_keys[0]'config entry:
When enabling theSFTPdport it configures it again.
Just tested this.Could please share the real log file from your @sftpgo app via https://paste.cloudron.io/ ?
-
-
Hello @valexico
When
SFTPdis not enabled the host_key for SFTPd will not be configured.
So when you enableSFTPdand save, it will restart the app and configure the default host_key.Please answer the following question:
You did install the app without
SFTPdenabled.
Then you did what exactly to get to the state of:No host keys configured and "id_rsa" does not exist; try to create a new host key
error creating host key "id_rsa": open id_rsa: read-only file system
could not start SFTP server: open id_rsa: read-only file system
Healthcheck error: AbortError: The operation was aborted -
I just install the app without SFTPd and then the app was not able to start with those logs
https://paste.cloudron.io/p/mole-panda-whalethen I did my workaround and restarted the app to boot properly
Workaround
"sftpd": {
"bindings": [{"port": 2022}],
"host_keys": ["/app/data/id_rsa", "/app/data/id_ecdsa", "/app/data/id_ed25519"]
} -
-
-
J james marked this topic as a question
-
J james has marked this topic as solved
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login
