Set up Kopia on SFTP Backend using rsync.net as a provider

Hi.
I tried to set up Kopia using SFTP but I wasn’t able to. I got the error below:

WARN unable to write diagnostics blob: unable to complete PutBlob(_log_20240929112901_1ff3_1727605741_1727605753_1_87bb58ec4fa77aea11bc866c6add7128) despite 10 retries: cannot create temporary file: cannot create directory: can't re-create top-level directory ./backups/kopia/test: top-level directory not found
ERROR error populating repository: error flushing writer: error flushing manifests: unable to write content: unable to create pending pack: unable to get session ID: unable to write session marker: unable to write session marker: s8c587722df979bb11cd5dbd635ffe711-s0ca56713703d729612d: unable to complete PutBlob(s8c587722df979bb11cd5dbd635ffe711-s0ca56713703d729612d) despite 10 retries: cannot create temporary file: cannot create directory: can't re-create top-level directory ./backups/kopia/test: top-level directory not found

I did try creating the folder path on my SFTP Provider manually before setting the path in Kopia but that hasn’t worked

Any ideas on what I should do?

Maybe start with posting details what exactly you are doing? Nobody can see your screen.

root@example:~/.ssh# kopia repository create sftp --path=./backups/kopia/test --host=example.rsync.net --username=example --keyfile=/root/.ssh/id_ed25519 --known-hosts=/root/.ssh/known_hosts
Enter password to create new repository: 
Re-enter password for verification: 
Initializing repository with:
  block hash:          BLAKE2B-256-128
  encryption:          AES256-GCM-HMAC-SHA256
  splitter:            DYNAMIC-4M-BUZHASH
Connected to repository.

NOTICE: Kopia will check for updates on GitHub every 7 days, starting 24 hours after first use.
To disable this behavior, set environment variable KOPIA_CHECK_FOR_UPDATES=false
Alternatively you can remove the file "/root/.config/kopia/repository.config.update-info.json".

Retention:
  Annual snapshots:                 3   (defined for this target)
  Monthly snapshots:               24   (defined for this target)
  Weekly snapshots:                 4   (defined for this target)
  Daily snapshots:                  7   (defined for this target)
  Hourly snapshots:                48   (defined for this target)
  Latest snapshots:                10   (defined for this target)
  Ignore identical snapshots:   false   (defined for this target)
Compression disabled.

To find more information about default policy run 'kopia policy get'.
To change the policy use 'kopia policy set' command.

NOTE: Kopia will perform quick maintenance of the repository automatically every 1h0m0s
and full maintenance every 24h0m0s when running as root@example.

See https://kopia.io/docs/advanced/maintenance/ for more information.

WARN unable to write diagnostics blob: unable to complete PutBlob(_log_20240929112901_1ff3_1727605741_1727605753_1_87bb58ec4fa77aea11bc866c6add7128) despite 10 retries: cannot create temporary file: cannot create directory: can't re-create top-level directory ./backups/kopia/test: top-level directory not found
ERROR error populating repository: error flushing writer: error flushing manifests: unable to write content: unable to create pending pack: unable to get session ID: unable to write session marker: unable to write session marker: s8c587722df979bb11cd5dbd635ffe711-s0ca56713703d729612d: unable to complete PutBlob(s8c587722df979bb11cd5dbd635ffe711-s0ca56713703d729612d) despite 10 retries: cannot create temporary file: cannot create directory: can't re-create top-level directory ./backups/kopia/test: top-level directory not found

Here is the link to the errors. I experience when trying to set up the SFTP Backend

Hi. Any answer to what I put below?

You would actually need to look at the logs from your FTP server, as it seems that there’s a permission error at that end. Kopia is only reporting its inability to write to that SFTP target.

Alright. On the provider I am using they don’t allow root access but via an account I am given.

Although, on the machine I wish to backup from is using the root user to perform the backup while the machine I wish to back to is using a specific non root user. Could that effect it?

Forget kopia for a moment and try with whatever ftp client you prefer (e.g. FileZilla). Does it work? Can you create dirs and send files? Using the same credentials you tried with kopia. If does not work then you have to solve your sftp access first.

Let me give that a try when I can.

So. I have tried via Username and Password and I was able to create and upload files using my storage provider account. Let me give public key authentication in Filezilla a try.

Solution to this was to contact my provider on what the right path to create folders was in
Which ended up working

1 Like