tlaanemaa / backup-docker

A simple command line tool to backup and restore docker containers along with their volumes
Apache License 2.0
65 stars 8 forks source link

Unable to run #29

Closed alexblueskypilot closed 2 years ago

alexblueskypilot commented 2 years ago

Hi,

When trying to run the script I have this error:

Unexpected token {

How can I fix that?

Thanks,

Alex.

tlaanemaa commented 2 years ago

Hey

I assume you mean the scripted backup scripts from here Do you know where the error occurs? Does it give you a line number or something like that? This seems very much like a syntax error but I checked the scripts and they seemed fine πŸ€”

alexblueskypilot commented 2 years ago

Hi!

No, I just run the command and the error appear then the script stops:

root@23-226-107-38:~# backup-docker backup Unexpected token {

Is there a specific log file or something I can check? I tried in root and normal user with sudo, same issue.

Thanks,

Alex.

alexblueskypilot commented 2 years ago

I tried to reinstall it and got some errors as well:

loadDep:ssh2 β†’ 304 ▐ β•’β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β•Ÿ /usr/local/bin/backup-docker -> /usr/local/lib/node_modules/backup-docker/bin/run.js

cpu-features@0.0.2 install /usr/local/lib/node_modules/backup-docker/node_modules/cpu-features node-gyp rebuild

make: Entering directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/build' ACTION Configuring dependencies /usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build/Makefile -- The C compiler identification is GNU 7.5.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Looking for dlfcn.h -- Looking for dlfcn.h - found -- Looking for getauxval -- Looking for getauxval - found -- Configuring done -- Generating done -- Build files have been written to: /usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build TOUCH Release/obj.target/config_deps.stamp ACTION Building dependencies /usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build/libcpu_features.a make[1]: Entering directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' make[2]: Entering directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' make[3]: Entering directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' Scanning dependencies of target unix_based_hardware_detection make[3]: Leaving directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' make[3]: Entering directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' [ 11%] Building C object CMakeFiles/unix_based_hardware_detection.dir/src/hwcaps.c.o [ 22%] Building C object CMakeFiles/unix_based_hardware_detection.dir/src/unix_features_aggregator.c.o make[3]: Leaving directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' [ 22%] Built target unix_based_hardware_detection make[3]: Entering directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' Scanning dependencies of target utils make[3]: Leaving directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' make[3]: Entering directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' [ 33%] Building C object CMakeFiles/utils.dir/src/filesystem.c.o [ 44%] Building C object CMakeFiles/utils.dir/src/stack_line_reader.c.o [ 55%] Building C object CMakeFiles/utils.dir/src/string_view.c.o make[3]: Leaving directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' [ 55%] Built target utils make[3]: Entering directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' Scanning dependencies of target cpu_features make[3]: Leaving directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' make[3]: Entering directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' [ 66%] Building C object CMakeFiles/cpu_features.dir/src/cpuinfo_x86.c.o [ 77%] Linking C static library libcpu_features.a make[3]: Leaving directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' [ 77%] Built target cpu_features make[3]: Entering directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' Scanning dependencies of target list_cpu_features make[3]: Leaving directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' make[3]: Entering directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' [ 88%] Building C object CMakeFiles/list_cpu_features.dir/src/utils/list_cpu_features.c.o [100%] Linking C executable list_cpu_features make[3]: Leaving directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' [100%] Built target list_cpu_features make[2]: Leaving directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' make[1]: Leaving directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/deps/cpu_features/build' TOUCH Release/obj.target/build_deps.stamp CXX(target) Release/obj.target/cpufeatures/src/binding.o SOLINK_MODULE(target) Release/obj.target/cpufeatures.node COPY Release/cpufeatures.node make: Leaving directory '/usr/local/lib/node_modules/backup-docker/node_modules/cpu-features/build'

ssh2@1.5.0 install /usr/local/lib/node_modules/backup-docker/node_modules/ssh2 node install.js

make: Entering directory '/usr/local/lib/node_modules/backup-docker/node_modules/ssh2/lib/protocol/crypto/build' CXX(target) Release/obj.target/sshcrypto/src/binding.o ../src/binding.cc: In member function β€˜void ChaChaPolyCipher::clear()’: ../src/binding.cc:88:7: error: β€˜EVP_MD_CTX_free’ was not declared in this scope EVP_MD_CTX_free(mdctx); ^~~~~~~ ../src/binding.cc:88:7: note: suggested alternative: β€˜EVP_MD_CTX_create’ EVP_MD_CTX_free(mdctx); ^~~~~~~ EVP_MD_CTX_create ../src/binding.cc: In member function β€˜ErrorType ChaChaPolyCipher::init(unsigned char, size_t)’: ../src/binding.cc:111:23: error: β€˜EVP_MD_CTX_new’ was not declared in this scope || (mdctx = EVP_MD_CTX_new()) == nullptr ^~~~~~ ../src/binding.cc:111:23: note: suggested alternative: β€˜EVP_MD_CTX_init’ || (mdctx = EVP_MD_CTX_new()) == nullptr ^~~~~~ EVP_MD_CTX_init ../src/binding.cc: In member function β€˜ErrorType ChaChaPolyCipher::encrypt(unsigned char, uint32_t, uint32_t)’: ../src/binding.cc:220:47: error: β€˜EVP_PKEYPOLY1305’ was not declared in this scope polykey = EVP_PKEY_new_raw_private_key(EVP_PKEY_POLY1305, ^~~~~ ../src/binding.cc:220:47: note: suggested alternative: β€˜EVP_PKEY_get1DH’ polykey = EVP_PKEY_new_raw_private_key(EVP_PKEY_POLY1305, ^~~~~ EVP_PKEY_get1_DH ../src/binding.cc:220:18: error: β€˜EVP_PKEY_new_raw_privatekey’ was not declared in this scope polykey = EVP_PKEY_new_raw_private_key(EVP_PKEY_POLY1305, ^~~~~~~~ ../src/binding.cc:220:18: note: suggested alternative: β€˜EVP_PKEY_new_mackey’ polykey = EVP_PKEY_new_raw_private_key(EVP_PKEY_POLY1305, ^~~~~~~~ EVP_PKEY_new_mac_key ../src/binding.cc:240:9: error: β€˜EVP_DigestSign’ was not declared in this scope if (EVP_DigestSign(mdctx, ^~~~~~ ../src/binding.cc:240:9: note: suggested alternative: β€˜EVP_DigestSignInit’ if (EVP_DigestSign(mdctx, ^~~~~~ EVP_DigestSignInit ../src/binding.cc: In member function β€˜ErrorType AESGCMCipher::init(const char, unsigned char, size_t, unsigned char, size_t)’: ../src/binding.cc:392:36: error: β€˜EVP_CTRL_AEAD_SET_IVLEN’ was not declared in this scope if (!EVP_CIPHER_CTXctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, iv_len, nullptr)) { ^~~~~~~ ../src/binding.cc:392:36: note: suggested alternative: β€˜EVP_CTRL_GCM_SET_IVLEN’ if (!EVP_CIPHER_CTXctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, iv_len, nullptr)) { ^~~~~~~ EVP_CTRL_GCM_SET_IVLEN ../src/binding.cc: In member function β€˜ErrorType AESGCMCipher::encrypt(unsigned char, uint32_t)’: ../src/binding.cc:474:29: error: β€˜EVP_CTRL_AEAD_GET_TAG’ was not declared in this scope EVP_CTRL_AEAD_GET_TAG, ^~~~~ ../src/binding.cc:474:29: note: suggested alternative: β€˜EVP_CTRL_CCM_GET_TAG’ EVP_CTRL_AEAD_GET_TAG, ^~~~~ EVP_CTRL_CCM_GET_TAG ../src/binding.cc: In member function β€˜void GenericCipher::clear()’: ../src/binding.cc:614:7: error: β€˜HMAC_CTX_free’ was not declared in this scope HMAC_CTX_free(ctxhmac); ^~~~~ ../src/binding.cc:614:7: note: suggested alternative: β€˜HMAC_CTX_copy’ HMAC_CTX_free(ctxhmac); ^~~~~ HMAC_CTX_copy ../src/binding.cc: In member function β€˜ErrorType GenericCipher::init(const char, unsigned char, size_t, unsigned char, size_t, const char, unsigned char, size_t, int)’: ../src/binding.cc:694:22: error: β€˜HMAC_CTX_new’ was not declared in this scope if ((ctxhmac = HMAC_CTX_new()) == nullptr ^~~~ ../src/binding.cc:694:22: note: suggested alternative: β€˜HMAC_CTX_init’ if ((ctxhmac = HMAC_CTX_new()) == nullptr ^~~~ HMAC_CTX_init ../src/binding.cc: In member function β€˜void ChaChaPolyDecipher::clear()’: ../src/binding.cc:956:7: error: β€˜EVP_MD_CTX_free’ was not declared in this scope EVP_MD_CTX_free(mdctx); ^~~~~~~ ../src/binding.cc:956:7: note: suggested alternative: β€˜EVP_MD_CTX_create’ EVP_MD_CTX_free(mdctx); ^~~~~~~ EVP_MD_CTX_create ../src/binding.cc: In member function β€˜ErrorType ChaChaPolyDecipher::init(unsigned char, size_t)’: ../src/binding.cc:979:23: error: β€˜EVP_MD_CTX_new’ was not declared in this scope || (mdctx = EVP_MD_CTX_new()) == nullptr ^~~~~~ ../src/binding.cc:979:23: note: suggested alternative: β€˜EVP_MD_CTX_init’ || (mdctx = EVP_MD_CTX_new()) == nullptr ^~~~~~ EVP_MD_CTX_init ../src/binding.cc: In member function β€˜ErrorType ChaChaPolyDecipher::decrypt(unsigned char, uint32_t, unsigned char, uint32_t)’: ../src/binding.cc:1097:47: error: β€˜EVP_PKEYPOLY1305’ was not declared in this scope polykey = EVP_PKEY_new_raw_private_key(EVP_PKEY_POLY1305, ^~~~~ ../src/binding.cc:1097:47: note: suggested alternative: β€˜EVP_PKEY_get1DH’ polykey = EVP_PKEY_new_raw_private_key(EVP_PKEY_POLY1305, ^~~~~ EVP_PKEY_get1_DH ../src/binding.cc:1097:18: error: β€˜EVP_PKEY_new_raw_privatekey’ was not declared in this scope polykey = EVP_PKEY_new_raw_private_key(EVP_PKEY_POLY1305, ^~~~~~~~ ../src/binding.cc:1097:18: note: suggested alternative: β€˜EVP_PKEY_new_mackey’ polykey = EVP_PKEY_new_raw_private_key(EVP_PKEY_POLY1305, ^~~~~~~~ EVP_PKEY_new_mac_key ../src/binding.cc: In member function β€˜ErrorType AESGCMDecipher::init(const char, unsigned char, size_t, unsigned char, size_t)’: ../src/binding.cc:1353:36: error: β€˜EVP_CTRL_AEAD_SET_IVLEN’ was not declared in this scope if (!EVP_CIPHER_CTXctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, iv_len, nullptr)) { ^~~~~~~ ../src/binding.cc:1353:36: note: suggested alternative: β€˜EVP_CTRL_GCM_SET_IVLEN’ if (!EVP_CIPHER_CTXctrl(ctx, EVP_CTRL_AEAD_SET_IVLEN, iv_len, nullptr)) { ^~~~~~~ EVP_CTRL_GCM_SET_IVLEN ../src/binding.cc: In member function β€˜ErrorType AESGCMDecipher::decrypt(unsigned char, uint32_t, unsigned char, unsigned char)’: ../src/binding.cc:1426:35: error: β€˜EVP_CTRL_AEAD_SET_TAG’ was not declared in this scope if (EVP_CIPHER_CTXctrl(ctx, EVP_CTRL_AEAD_SET_TAG, 16, tag) != 1) { ^~~~~ ../src/binding.cc:1426:35: note: suggested alternative: β€˜EVP_CTRL_GCM_SET_TAG’ if (EVP_CIPHER_CTXctrl(ctx, EVP_CTRL_AEAD_SET_TAG, 16, tag) != 1) { ^~~~~ EVP_CTRL_GCM_SET_TAG ../src/binding.cc: In member function β€˜void GenericDecipher::clear()’: ../src/binding.cc:1586:7: error: β€˜HMAC_CTX_free’ was not declared in this scope HMAC_CTX_free(ctxhmac); ^~~~~ ../src/binding.cc:1586:7: note: suggested alternative: β€˜HMAC_CTX_copy’ HMAC_CTX_free(ctxhmac); ^~~~~ HMAC_CTX_copy ../src/binding.cc: In member function β€˜ErrorType GenericDecipher::init(const char, unsigned char, size_t, unsigned char, size_t, const char, unsigned char*, size_t, int, size_t)’: ../src/binding.cc:1667:22: error: β€˜HMAC_CTX_new’ was not declared in this scope if ((ctxhmac = HMAC_CTX_new()) == nullptr ^~~~ ../src/binding.cc:1667:22: note: suggested alternative: β€˜HMAC_CTX_init’ if ((ctxhmac = HMAC_CTX_new()) == nullptr ^~~~ HMAC_CTX_init sshcrypto.target.mk:97: recipe for target 'Release/obj.target/sshcrypto/src/binding.o' failed make: *** [Release/obj.target/sshcrypto/src/binding.o] Error 1 make: Leaving directory '/usr/local/lib/node_modules/backup-docker/node_modules/ssh2/lib/protocol/crypto/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:258:23) gyp ERR! stack at emitTwo (events.js:126:13) gyp ERR! stack at ChildProcess.emit (events.js:214:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12) gyp ERR! System Linux 4.15.0-161-generic gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "--target=v8.10.0" "rebuild" gyp ERR! cwd /usr/local/lib/node_modules/backup-docker/node_modules/ssh2/lib/protocol/crypto gyp ERR! node -v v8.10.0 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok Failed to build optional crypto binding /usr/local/lib └─┬ backup-docker@1.5.5 β”œβ”€β”€ commander@4.1.1 β”œβ”€β”¬ dockerode@3.3.1 β”‚ β”œβ”€β”¬ docker-modem@3.0.3 β”‚ β”‚ β”œβ”€β”¬ debug@4.3.3 β”‚ β”‚ β”‚ └── ms@2.1.2 β”‚ β”‚ β”œβ”€β”¬ readable-stream@3.6.0 β”‚ β”‚ β”‚ β”œβ”€β”€ inherits@2.0.4 β”‚ β”‚ β”‚ β”œβ”€β”¬ string_decoder@1.3.0 β”‚ β”‚ β”‚ β”‚ └── safe-buffer@5.2.1 β”‚ β”‚ β”‚ └── util-deprecate@1.0.2 β”‚ β”‚ β”œβ”€β”€ split-ca@1.0.1 β”‚ β”‚ └─┬ ssh2@1.5.0 β”‚ β”‚ β”œβ”€β”¬ asn1@0.2.6 β”‚ β”‚ β”‚ └── safer-buffer@2.1.2 β”‚ β”‚ β”œβ”€β”¬ bcrypt-pbkdf@1.0.2 β”‚ β”‚ β”‚ └── tweetnacl@0.14.5 β”‚ β”‚ β”œβ”€β”€ cpu-features@0.0.2 β”‚ β”‚ └── nan@2.15.0 β”‚ └─┬ tar-fs@2.0.1 β”‚ β”œβ”€β”€ chownr@1.1.4 β”‚ β”œβ”€β”€ mkdirp-classic@0.5.3 β”‚ β”œβ”€β”¬ pump@3.0.0 β”‚ β”‚ β”œβ”€β”€ end-of-stream@1.4.4 β”‚ β”‚ └─┬ once@1.4.0 β”‚ β”‚ └── wrappy@1.0.2 β”‚ └─┬ tar-stream@2.2.0 β”‚ β”œβ”€β”¬ bl@4.1.0 β”‚ β”‚ └─┬ buffer@5.7.1 β”‚ β”‚ β”œβ”€β”€ base64-js@1.5.1 β”‚ β”‚ └── ieee754@1.2.1 β”‚ └── fs-constants@1.0.0 └── limit-async@1.3.0

alexblueskypilot commented 2 years ago

Hi! Any idea on what I can try to fix that? Thanks!

tlaanemaa commented 2 years ago

Hey, sorry for the late reply. Sorry, I don't have a lot of answers here, I haven't seen this before πŸ€” It seems like you have an issue with node-gyp not being able to run make

gyp ERR! stack Error: make failed with exit code: 2

What operating system are you on? I just tried on MacOS 12.1 and it installed and ran without a hitch πŸ€” Also, are you on x86 or ARM? For example, if it's an M1 Mac then that might have an effect. I have tested and it worked on a Raspberry PI 4 but I don't have an M1 mac to test with sadly :/

See if you can figure out the node-gyp issue and if it works then :) Let me know if you need more help!

tlaanemaa commented 2 years ago

Hey πŸ‘‹ I hope you managed to get it working. This seems inactive so I'll close it for now but please feel free to reopen if you still need help.