v5 - backups wonky when using S3
Just leaving this here for me...
I need to figure out the weird path issues for backing up and downloading backups from S3. There is a slight inconsistency between local and S3 which is causing it to look like backups aren't being performed.
WIP on my end, just didn't want to lose track of it.
Yup, got this error when I tested S3 setup on my local (latest v5.3.5):
Error executing "ListObjects" on "https://MYBUCKET.s3.REGION.amazonaws.com/?prefix=private%2Fapp%2Fbackups%2F&delimiter=%2F&encoding-type=url"; AWS ▶
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AuthorizationHeaderMalformed</Code><Message>The authorization header (truncated...)
AuthorizationHeaderMalformed (client): The authorization header is malformed; the Credential is mal-formed; expecting "<YOUR-AKID>/YYYYMMDD/REGION/SERVICE/aws4 ▶
<Error><Code>AuthorizationHeaderMalformed</Code><Message>The authorization header is malformed; the Credential is mal-formed; expecting "<YOUR-AKID>/YYYYM
Yeah, it's a known issue :( We use a library, so now we have to have to figure out whether or not we fork, patch, or home-grow it :(
Update with v6.0.10 and working S3 access key
Running php artisan backup:run does not work. Same with UI.
Starting backup...
Dumping database snipe-it...
Determining files to backup...
Zipping 22 files and directories...
Created zip containing 22 files and directories. Size is 93.25 KB
Copying zip to disk named backup...
Copying zip failed because: There is a connection error when trying to connect to disk named `backup`.
Backup completed!
Argh. I'll take a look at the library we use and see if any of their S3 support has gotten better and if there's anything we can do on our end to make it work better. (I don't think a lot of people use S3, so it doesn't come up that often.)
We run Snipe-IT quite the "cloud" way:
- Digital Ocean App Platform - so Snipe running in Docker container
- Digital Ocean DBaaS - external database
- assets in S3 - as container is ephemeral and without persistent mount (App Platform does not have that)
Whenever there is a new Snipe-IT version, we just update the docker image tag and we'll good 👍