You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
deploy/systemd/sponsord.service: daemon refuses its keystore credential on systemd 255 (0440) #36
Install the reference unit unchanged as /etc/systemd/system/sponsord.service, and the binary at /usr/local/bin/sponsord.
Provision /etc/sponsord/{api-token,treasury-password,treasury-keystore.json} at 0600 (the keystore comes from decdn key-gen), and a sponsord.env with RPC URL, PaymentPool address and pool id, as the unit's header says.
Run systemctl daemon-reload && systemctl start sponsord.
Expected behavior
The daemon loads the keystore credential and proceeds to the chain connection.
Actual behavior
It exits at startup, and Restart=on-failure keeps restarting it:
Error: invalid eth keystore: /run/credentials/sponsord.service/treasury-keystore.json has insecure permissions 0o440 (must be user-only, e.g. 0o600)
On this systemd, LoadCredential= files land at mode 0440. SPONSORD_TREASURY_KEYSTORE=%d/treasury-keystore.json points sponsord straight at that file. decdn's validate_keystore_file (decdn-incentiveeth_identity.rs) rejects any group or other permission bit, so the keystore is refused.
On Debian 12 (systemd 252) the same credential lands at 0400 and passes, so the unit works there. I have not pinned the exact systemd release that changed the mode.
Possible fixes
Unit only, the workaround the decdn/devops Ansible role uses (feat(sponsord): add the sponsord role, standalone or beside a node devops#82): copy the keystore credential into a private runtime directory at 0600 before start, and point the daemon there. The file is the encrypted keystore, and the password stays in %d.
Verified on systemd 252 and 255 with the real binary. It gets past credential loading, the permission check and decryption.
Or in code: accept group-read when the keystore is inside $CREDENTIALS_DIRECTORY. systemd already restricts that directory to the unit.
Logs
systemd 255 (255.4-1ubuntu8.17)
Error: invalid eth keystore: /run/credentials/sponsord.service/treasury-keystore.json has insecure permissions 0o440 (must be user-only, e.g. 0o600)
Component
sponsord (signing daemon), specifically the reference unit
deploy/systemd/sponsord.serviceVersion
Built from
0e85070(sponsord 0.1.0)Operating system
Ubuntu 24.04 x86_64, systemd 255 (255.4-1ubuntu8.17)
Steps to reproduce
/etc/systemd/system/sponsord.service, and the binary at/usr/local/bin/sponsord./etc/sponsord/{api-token,treasury-password,treasury-keystore.json}at0600(the keystore comes fromdecdn key-gen), and asponsord.envwith RPC URL, PaymentPool address and pool id, as the unit's header says.systemctl daemon-reload && systemctl start sponsord.Expected behavior
The daemon loads the keystore credential and proceeds to the chain connection.
Actual behavior
It exits at startup, and
Restart=on-failurekeeps restarting it:On this systemd,
LoadCredential=files land at mode0440.SPONSORD_TREASURY_KEYSTORE=%d/treasury-keystore.jsonpoints sponsord straight at that file. decdn'svalidate_keystore_file(decdn-incentiveeth_identity.rs) rejects any group or other permission bit, so the keystore is refused.On Debian 12 (systemd 252) the same credential lands at
0400and passes, so the unit works there. I have not pinned the exact systemd release that changed the mode.Possible fixes
0600before start, and point the daemon there. The file is the encrypted keystore, and the password stays in%d.$CREDENTIALS_DIRECTORY. systemd already restricts that directory to the unit.Logs