When restore to a new env I the the following error

Hi, when I restore mongo from object storage (swift use s3), get the following error

Waiting to finish.Error: operation failed with: mongorestore: restore mongo dump (successes: 0 / fails: 0): I/O failure reading beginning of archive: invalid input: magic number mismatch

percona-backup-mongodb v2.1.0

config:

pitr:
  enabled: false
  oplogSpanMin: 10
  compression: zstd
storage:
  type: s3
  s3:
    provider: aws
    region: us-east-1
    endpointUrl: https://swift.elastx.cloud
    bucket: test
    prefix: test-20230515072203/mongo
    credentials:
      access-key-id: '***'
      secret-access-key: '***'
    maxUploadParts: 10000
    storageClass: STANDARD
    insecureSkipTLSVerify: false
restore:
  batchSize: 50
  numInsertionWorkers: 2
backup:
  compression: s2

Any idea?

Hi @Max_Chen ,

Since 2.0, PBM stores each collection in a separate file. Each file is a “concat” of BSON documents of the collection.
The BSON document has 4 bytes prefix (the magic number). It seems one of the documents is invalid.

Are you restoring from a backup made before PBM 2.0? Is it full logical restore? is that backup is full (non-selective)?

@Dmytro_Zghoba Thanks for your reply
I got the reason for the error. I restore the backup from 1.7.0 using pbm 2.1.0

It could be a bug. PBM should handle backups made by 1.7. I’ve created a ticket.

Could you please leave a comment in the ticket with the output of pbm describe-backup $THE_BACKUP_NAME ? It helps to identify the problem quickly.

Thanks

Sorry, I have deleted the backup. Our mongo cluster has 3 nodes, The error is because some backup agents used 1.7.0 but some agents used 2.1.0, after I upgrade all the agents to 2.1.0 there is no error

good to know. thanks