balena-io / open-balena-s3

Amazon S3-compatible storage backend for openBalena
balena.io/open
GNU Affero General Public License v3.0
13 stars 11 forks source link

Update minio version #155

Open shaunco opened 1 year ago

shaunco commented 1 year ago

As of the day this issue was created, the latest minio version is RELEASE.2023-08-29T23-07-35Z, but the Dockerfile in this repo is still making use of RELEASE.2022-05-04T07-45-27Z - which is now ~15 months old. Minio has addressed at least 7 CVEs over this time.

klutchell commented 1 year ago

Thanks for raising this! It should be addressed by https://github.com/balena-io/open-balena-s3/pull/160

shaunco commented 1 year ago

@klutchell - looks like no good deed goes unpunished...

Sep 04 04:30:57 5d14786b7ad1 systemd[1]: open-balena-s3.service: Main process exited, code=exited, status=1/FAILURE
Sep 04 04:30:57 5d14786b7ad1 systemd[1]: open-balena-s3.service: Failed with result 'exit-code'.
Sep 04 04:30:57 5d14786b7ad1 systemd[1]: open-balena-s3.service: Scheduled restart job, restart counter is at 9441.
Sep 04 04:30:57 5d14786b7ad1 systemd[1]: Stopped open-balena-s3.service - open-balena-s3.
Sep 04 04:30:58 5d14786b7ad1 systemd[1]: Starting open-balena-s3.service - open-balena-s3...
Sep 04 04:30:58 5d14786b7ad1 systemd[1]: Started open-balena-s3.service - open-balena-s3.
Sep 04 04:30:58 5d14786b7ad1 minio[969828]: ERROR Unable to use the drive /export: Drive /export: found backend type fs, expected xl or xl-single - to migrate to a supported backend visit https://min.io/docs/minio/linux/operations/install-deploy-manage/migrate-fs-gateway.html: Invalid arguments specified

Looks like https://github.com/balena-io/open-balena/blob/ea07d43c5c7e98bb8b11c808b12428a46019c8d5/compose/services.yml#L8C8-L8C8 needs to be updated to:

volumes:
...
   s3:
      driver: local

And the fun from https://min.io/docs/minio/linux/operations/install-deploy-manage/migrate-fs-gateway.html

For my local test instance, the following fixed it - but I'm not sure how to generically detect that this needs to happen:

systemctl stop open-balena-s3
rm -rf /export/.minio.sys
systemctl start open-balena-s3

When minio was restarted it seems to have rebuilt its .minio.sys folder in the way it wanted.

klutchell commented 1 year ago

Thanks for checking! I'll revert to a release before that change until we can add some tests to this repo, and some migration steps to open-balena.