snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

v5 - backups wonky when using S3

Open snipe opened this issue 5 years ago • 5 comments

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.

snipe avatar Nov 13 '20 20:11 snipe

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 "&lt;YOUR-AKID&gt;/YYYYM

back-2-95 avatar Dec 14 '21 05:12 back-2-95

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 :(

snipe avatar Dec 14 '21 06:12 snipe

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!

back-2-95 avatar Sep 22 '22 10:09 back-2-95

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.)

snipe avatar Sep 22 '22 17:09 snipe

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 👍

back-2-95 avatar Sep 23 '22 03:09 back-2-95