apotdevin / thunderhub

ThunderHub LND Lightning Node Manager in your Browser
https://www.thunderhub.io/
MIT License
413 stars 84 forks source link

Thunderhub and auto backup to Amboss doesn't work #555

Open Perlover opened 1 year ago

Perlover commented 1 year ago

Describe the problem/bug

I have an account on Amboss, also inside Thunderhub under BTCPay I set auto backup (screenshot: https://nostr.build/p/nb12245.png). I have an automatic backup of the SCB file. In manual mode (by pressing the "Push" button in Thunderhub) - backup works fine (screenshot, only manual backups are visible there: https://nostr.build/p/nb12244.png). But it doesn't work automatically.

Your environment

To Reproduce

In addition to Thunder hub backup, I have a bash script running that monitors changes to the scb file through the inotifywait -e modify -e attrib $SCB_SOURCE_FILE command. When I open a channel, the file changes twice (immediately after funding and the second time after the required number of confirmations to open the channel) and my script executes backup twice in the git repository. But according to the logs of the generated_bitcoin_thub_1 docker container, nothing happens at this time (to see logs of example). Only JSON logs that the channel is started to open and that there is no longer one channel.

I believe that either the Thundersub monitoring script is not running, or there are some problems with it in crontab. Since backup works in manual mode, apparently Thunderhub has access to the file and rights.

I created a ticket on BTCPay, but they are sure that the problem is in your software.

Even right now I decided to check again and went to Amboss. I have the last backup there from July 5. Inside my ThunderHub, an automatic backup option is enabled. Then I manually pressed Push button (Push Backup to Amboss) and after that backup successfully appeared in amboss with a much larger file size. From this I conclude that automatic tracking and sending of backup file do not work at any stage.

Expected behavior

If an automatic Backup is turned on (Thunderhub / Amboss / Backups / "By disabling automatic backups to Amboss, ThunderHub will no longer push encrypted backups" / We see the button like "Disable"), then it should work.

Actual behavior

To see above

Screenshots/Links

https://nostr.build/p/nb12245.png

https://nostr.build/p/nb12244.png

Relevant log output

First time when just opened channel:

{
  openParams: {
    is_private: false,
    local_tokens: 1700000,
    chain_fee_tokens_per_vbyte: 9,
    partner_public_key: '03f0a7ca4db43e1a3ef3bf3817203cb67f7e3ef3b64746116ef98a351e8559c337',
    give_tokens: 0
  },
  level: 'info',
  message: 'Opening channel with params',
  timestamp: '2023-07-03T15:45:08.251Z'
}
{
  message: 'Channel opened',
  level: 'info',
  timestamp: '2023-07-03T15:45:11.182Z'
}
{
  onchainBalance: true,
  pendingChannelBalance: true,
  amountOfChannels: 6,
  finalMessage: '2023-07-03T15:46:07.388Z40000501621696530170000042540001f10c921da84507ea28da1348834933aaa4c82c24e35a5796b2a97754',
  signature: 'rynf933gctfac9f5469seuwyecrena86bnf1msq3594hp5phwdx941ni6jtj81n13jwotuqn7oa8ec7re7ju9t5zw6yjcdehr7hwjorw',
  level: 'info',
  message: 'Push Info',
  timestamp: '2023-07-03T15:46:07.392Z'
}
{
  onchainBalance: true,
  pendingChannelBalance: true,
  amountOfChannels: 6,
  finalMessage: '2023-07-03T15:47:07.318Z40000501621696530170000042540001f10c921da84507ea28da1348834933aaa4c82c24e35a5796b2a97754',
  signature: 'd77pixotdp7ueyifa5sapqij64bmmy5msx91xtfyzhdyqy4rw3hpg4m6gobqqmqexejnrc3cpfahyxrxszund6ygn7y4ngtiz63ce4xd',
  level: 'info',
  message: 'Push Info',
  timestamp: '2023-07-03T15:47:07.321Z'
}

And second part of logs when channel was opened:

{
  onchainBalance: true,
  pendingChannelBalance: true,
  amountOfChannels: 6,
  finalMessage: '2023-07-03T16:21:07.434Z9016201696530170000042540001f10c921da84507ea28da1348834933aaa4c82c24e35a5796b2a97754',
  signature: 'rby8yigo7ywzusz5oth7bp44z9pzgmsaifq83p4ms4gfcqwyepnoaihepptr5yp36bz3wmjocinnrxw9qsm5ur37thks9f8xgj9sdsa9',
  level: 'info',
  message: 'Push Info',
  timestamp: '2023-07-03T16:21:07.438Z'
}
{
  onchainBalance: true,
  pendingChannelBalance: true,
  amountOfChannels: 6,
  finalMessage: '2023-07-03T16:22:07.399Z9016201696530170000042540001f10c921da84507ea28da1348834933aaa4c82c24e35a5796b2a97754',
  signature: 'd6a9pi1snk9uyrxhx8q83bus1q35nbq7uaz3sy51cwkrmdbdhqo9hj3m1xfh1dahsn48rdsb6pu9a16fpinx9ehpmhkudmmrc933s6hk',
  level: 'info',
  message: 'Push Info',
  timestamp: '2023-07-03T16:22:07.401Z'
}
{
  onchainBalance: true,
  pendingChannelBalance: true,
  amountOfChannels: 7,
  finalMessage: '2023-07-03T16:23:07.415Z90162000ab0837a97ff52270c5750ea7c81134d09724cd6506fb4f54b16c8fd227b1e994',
  signature: 'rybtus4onj376izdmwf7q7crboywtyry8nc3fywnhf46qzefjnnc6r6e6b5ypzfnpsesaztqrrouiun1j11a4aqi5bc6q977it1tewtj',
  level: 'info',
  message: 'Push Info',
  timestamp: '2023-07-03T16:23:07.417Z'
}
{
  onchainBalance: true,
  pendingChannelBalance: true,
  amountOfChannels: 7,
  finalMessage: '2023-07-03T16:24:07.399Z90162000ab0837a97ff52270c5750ea7c81134d09724cd6506fb4f54b16c8fd227b1e994',
  signature: 'ry14srp4itko6of9ix1roaj5ynb9rc11ppno8okmea8e3coxf9ts68459hb7ce6nrgikt58x73a8jbg7ig9ude93iwm7hdwwqcftnaqh',
  level: 'info',
  message: 'Push Info',
  timestamp: '2023-07-03T16:24:07.401Z'
}

At the same time, my script detects and commits the modified scb file (UTC time everywhere)

commit a4da5e83b9a06394f5a98506f32b26062cfd5e3b
Author: RaspiBolt <raspibolt@dummyemail.com>
Date:   Mon Jul 3 16:23:03 2023 +0000

    Static Channel Backup 20230703-162303

commit efb835d92df24f2b45786aa1ddaced963f70ea3c
Author: RaspiBolt <raspibolt@dummyemail.com>
Date:   Mon Jul 3 15:45:11 2023 +0000

    Static Channel Backup 20230703-154511
mariodian commented 5 months ago

I have a similar issue that may or may not be related. I can manually push the backup to amboss however, I can't even enable auto bakcups in thunderhub.

I get the following error:

{
    "errors": [
        {
            "message": "Error enabling auto backups",
            "locations": [
                {
                    "line": 2,
                    "column": 3
                }
            ],
            "path": [
                "toggleConfig"
            ],
            "extensions": {
                "code": "INTERNAL_SERVER_ERROR",
                "stacktrace": [
                    "Error: Error enabling auto backups",
                    "    at UserConfigService.toggleValue (/home/ubuntu/source/Bitcoin/thunderhub/dist/modules/api/userConfig/userConfig.service.js:55:19)",
                    "    at UserConfigService.toggleAutoBackups (/home/ubuntu/source/Bitcoin/thunderhub/dist/modules/api/userConfig/userConfig.service.js:80:14)",
                    "    at UserConfigResolver.toggleConfig (/home/ubuntu/source/Bitcoin/thunderhub/dist/modules/api/userConfig/userConfig.resolver.js:139:40)",
                    "    at /home/ubuntu/source/Bitcoin/thunderhub/node_modules/@nestjs/core/helpers/external-context-creator.js:67:33",
                    "    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)",
                    "    at async target (/home/ubuntu/source/Bitcoin/thunderhub/node_modules/@nestjs/core/helpers/external-context-creator.js:74:28)",
                    "    at async Object.toggleConfig (/home/ubuntu/source/Bitcoin/thunderhub/node_modules/@nestjs/core/helpers/external-proxy.js:9:24)"
                ]
            }
        }
    ],
    "data": null
}

Thunderhub 0.13.30