Error code 255 when using script

Duplicati - 2.0.2.1_beta_2017-08-01 in a Docker in my unRAID.

I am trying to use the options “–run-script-before-required” and “–run-script-after” to trigger some actions but I am always getting an error: The script “/path/to/script/foobar.sh” returned with exit code 255.

I’ve searched for error code 255 without much luck.

The path is accessible inside and outside the container. I can even run manually the script if I am inside the docker container without any problem.

Does you script exit with a specific exit code?
255 is a general failure error code.

There are some examples that ship with Duplicati (not sure where they are in Linux) that can give you an example of generating a return code.

Try a simple script, such as “env >/tmp/env.txt” to verify that the script is being called, and then make sure to add an exit code.

Most scripts default to existing with exit code 0, but some commands will exit with 255.

Oh, and keep in mind that if duplicati is running as a service, it won’t have a profile, so you’ll have to set any PATH or similar requirements.

Share your script if you want some add’l thoughts.

My script should return exit code 0. The funny thing is that after I started and stopped the Docker container I don’t get an error code anymore, however the script is not been called by the Duplicati job and via command line I get an error code 1

#/bin/bash

curl -k -s \
-X POST \
https://api.telegram.org/botfoobarfoobar:FooBarFooBar/sendMessage \
-d text="$1" \
-d chat_id=12345678 \

exit 0
Backup started at 11/12/2017 1:15:33 AM
Checking remote backup ...
  Listing remote folder ...
Scanning local files ...
  2 files need to be examined (3.84 KB) (still counting)
  0 files need to be examined (0 bytes)
No remote filesets were deleted
Checking remote backup ...
  Listing remote folder ...
removing file listed as Temporary: duplicati-bea4ebc6a03c345d5b2ba6e04336e657c.dblock.zip.aes
removing file listed as Temporary: duplicati-i6d2d9eaf899544168126866be9124fdf.dindex.zip.aes
Verifying remote backup ...
Remote backup verification completed
  Downloading file (517.90 KB) ...
  Downloading file (100.67 KB) ...
  Downloading file (49.92 MB) ...
  Duration of backup: 00:00:11
  Remote files: 1060
  Remote size: 25.79 GB
  Files added: 0
  Files deleted: 0
  Files changed: 0
  Data uploaded: 0 bytes
  Data downloaded: 50.52 MB
Backup completed successfully!
Return code: 1

I wonder if the curl command is returning the error and exiting the script. Try replacing that with something innocuous, like “touch /tmp/blah”

-Dave

I started from scratch everything (Docker, Duplicati Jobs, Script) and now it is working fine.

Sorry we weren’t able to figure out the original cause, but I’m glad to hear things are working correctly for you now.