UnstoppableSwap / unstoppableswap-gui

Graphical User Interface (GUI) For Trustless Cross-Chain XMR<>BTC Atomic Swaps
https://unstoppableswap.net/
MIT License
263 stars 15 forks source link

0.6.2 Linux Debian 11 - "The swap daemon has stopped unexpectedly" - read only FS (/tmp/...) #209

Open slrslr opened 2 months ago

slrslr commented 2 months ago

Expected Behavior

Start without error

Current Behavior

Inside GUI right after start it shows "The swap daemon has stopped unexpectedly" Inside CLI it shows:

$ /home/user/Downloads/UnstoppableSwap-0.6.2.AppImage
[1720148857212] DEBUG (2462562 on hostname): Connecting to UnstoppableSwap Socket API
    host: "api.unstoppableswap.net"
    path: "/api/socket.io"
    agent: false

[2462562:0705/050737.218366:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.portal.Settings.Read: object_path= /org/freedesktop/portal/desktop: org.freedesktop.portal.Error.NotFound: Requested setting not found
[1720148857234] ERROR (2462562 on hostname): Failed to make swap binary executable
    binary: {
      "dirPath": "/tmp/.mount_Unstop2GYY3y/resources/bin",
      "fileName": "0_13_2_swap"
    }
    err: {
      "type": "Error",
      "message": "EROFS: read-only file system, chmod '/tmp/.mount_Unstop2GYY3y/resources/bin/0_13_2_swap'",
      "stack":
          Error: EROFS: read-only file system, chmod '/tmp/.mount_Unstop2GYY3y/resources/bin/0_13_2_swap'
      "errno": -30,
      "code": "EROFS",
      "syscall": "chmod",
      "path": "/tmp/.mount_Unstop2GYY3y/resources/bin/0_13_2_swap"
    }

[1720148857348] ERROR (2462562 on hostname): Attempted monero-wallet-rpc kill using command failed
    e: {
      "code": 123,
      "killed": false,
      "signal": null,
      "cmd": "ps aux | grep 'monero-wallet-rpc' | grep -v 'grep' | awk '{print $2}' | xargs kill -9",
      "stdout": "",
      "stderr": "\nUsage:\n kill [options] <pid> [...]\n\nOptions:\n <pid> [...]            send signal to every <pid> listed\n -<signal>, -s, --signal <signal>\n                        specify the <signal> to be sent\n -q, --queue <value>    integer value to be sent with the signal\n -l, --list=[<signal>]  list all signal names, or convert one to a name\n -L, --table            list all signal names in a nice table\n\n -h, --help     display this help and exit\n -V, --version  output version information and exit\n\nFor more details see kill(1).\n"
    }

running stat command on /tmp, it shows: Access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root) i am running the AppImage under regular user grep tmp /etc/fstab # empty output

AppImage stat: Access: (0755/-rwxr-xr-x) Uid: ( 1000/ user) Gid: ( 1000/ user) sudo /home/user/Downloads/UnstoppableSwap-0.6.2.AppImage --no-sandbox # issue remains

Other apps works per "mount" output: feather-wallet.AppImage on /tmp/.mount_featheXGLiOE type fuse.feather-wallet.AppImage (ro,nosuid,nodev,relatime,user_id=1000,group_id=1000)

.deb version of the US has similar issue:

      "stack":
          Error: EPERM: operation not permitted, chmod '/opt/UnstoppableSwap/resources/bin/0_13_2_swap'
      "errno": -1,
      "code": "EPERM",

Your Environment

binarybaron commented 2 months ago

We're looking into it. Thanks for the report! I haven't been able to replicate this yet.

binarybaron commented 2 months ago

@Einliterflasche Can you to reproduce this on your linux machine?

symb10sis commented 1 week ago

I have the same issue with the AppImage version 0.6.3 on Tails Linux (debian based) and on Endeavour Linux (arch based) running the AppImage as a normal non-root user. This bug also seems to be the reason for issue #175 as the AppImage can't change the permissions for the tor binary and thus fails to run the following steps to start it.

This are the permissions the AppImage got in the /tmp/ directory:

[EXAMPLE-USER@EXAMPLE-ARCHLINUX-HOST tmp]$ ls -l
drwxr-xr-x  5 root root   0  1. Aug 18:55 .mount_Unstop7GhyMv

This are the permissions in the directory the AppImage created in the /tmp/ location:

[EXAMPLE-USER@EXAMPLE-ARCHLINUX-HOST .mount_UnstopU9GVg2]$ ls -l
total 212219
lrwxr-xr-x 1 root root        62  1. Aug 18:54 .DirIcon -> usr/share/icons/hicolor/1024x1024/apps/unstoppableswap-gui.png
-rwxr-xr-x 1 root root      2360  1. Aug 18:54 AppRun
-rw-r--r-- 1 root root      1096  1. Aug 18:54 LICENSE.electron.txt
-rw-r--r-- 1 root root   8855757  1. Aug 18:54 LICENSES.chromium.html
-rwxr-xr-x 1 root root     54096  1. Aug 18:55 chrome-sandbox
-rw-r--r-- 1 root root    136399  1. Aug 18:54 chrome_100_percent.pak
-rw-r--r-- 1 root root    197477  1. Aug 18:54 chrome_200_percent.pak
-rwxr-xr-x 1 root root   1250448  1. Aug 18:54 chrome_crashpad_handler
-rw-r--r-- 1 root root  10631872  1. Aug 18:54 icudtl.dat
-rwxr-xr-x 1 root root    252200  1. Aug 18:55 libEGL.so
-rwxr-xr-x 1 root root   6503984  1. Aug 18:54 libGLESv2.so
-rwxr-xr-x 1 root root   2881952  1. Aug 18:54 libffmpeg.so
-rwxr-xr-x 1 root root   4590880  1. Aug 18:55 libvk_swiftshader.so
-rwxr-xr-x 1 root root   7159712  1. Aug 18:54 libvulkan.so.1
drwxr-xr-x 2 root root         0  1. Aug 18:54 locales
drwxr-xr-x 4 root root         0  1. Aug 18:54 resources
-rw-r--r-- 1 root root   5415024  1. Aug 18:54 resources.pak
-rw-r--r-- 1 root root    268732  1. Aug 18:54 snapshot_blob.bin
-rwxr-xr-x 1 root root 168518728  1. Aug 18:55 unstoppableswap-gui
-rw-r--r-- 1 root root       261  1. Aug 18:54 unstoppableswap-gui.desktop
lrwxr-xr-x 1 root root        62  1. Aug 18:54 unstoppableswap-gui.png -> usr/share/icons/hicolor/1024x1024/apps/unstoppableswap-gui.png
drwxr-xr-x 4 root root         0  1. Aug 18:54 usr
-rw-r--r-- 1 root root    595812  1. Aug 18:54 v8_context_snapshot.bin
-rw-r--r-- 1 root root       107  1. Aug 18:54 vk_swiftshader_icd.json
[EXAMPLE-USER@EXAMPLE-ARCHLINUX-HOST Downloads]$ ./UnstoppableSwap-0.6.3.AppImage
[1726816756089] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): Connecting to UnstoppableSwap Socket API
    host: "api.unstoppableswap.net"
    path: "/api/socket.io"
    agent: false
[1726816756130] ERROR (8356 on EXAMPLE-ARCHLINUX-HOST): Failed to make swap binary executable
    binary: {
      "dirPath": "/tmp/.mount_Unstop4VHdDq/resources/bin",
      "fileName": "0_13_4_swap"
    }
    err: {
      "type": "Error",
      "message": "EROFS: read-only file system, chmod '/tmp/.mount_Unstop4VHdDq/resources/bin/0_13_4_swap'",
      "stack":
          Error: EROFS: read-only file system, chmod '/tmp/.mount_Unstop4VHdDq/resources/bin/0_13_4_swap'
      "errno": -30,
      "code": "EROFS",
      "syscall": "chmod",
      "path": "/tmp/.mount_Unstop4VHdDq/resources/bin/0_13_4_swap"
    }
[1726816756190] ERROR (8356 on EXAMPLE-ARCHLINUX-HOST): Attempted monero-wallet-rpc kill using command failed
    e: {
      "code": 123,
      "killed": false,
      "signal": null,
      "cmd": "ps aux | grep 'monero-wallet-rpc' | grep -v 'grep' | awk '{print $2}' | xargs kill -9",
      "stdout": "",
      "stderr": "kill: not enough arguments\n"
    }
[1726816756201] INFO (8458 on EXAMPLE-ARCHLINUX-HOST): Spawned CLI process
    args: [
      "./0_13_4_swap",
      "--json",
      "--debug",
      "--data-base-dir",
      "/home/EXAMPLE-USER/.local/share/xmr-btc-swap/cli",
      "start-daemon",
      "--server-address",
      "0.0.0.0:1234"
    ]
    cwd: "/tmp/.mount_Unstop4VHdDq/resources/bin"
    subCommand: "start-daemon"
[1726816756205] ERROR (8356 on EXAMPLE-ARCHLINUX-HOST): Failed to make tor binary executable
    torBinary: {
      "dirPath": "/tmp/.mount_Unstop4VHdDq/resources/bin",
      "fileName": "tor"
    }
    err: {
      "type": "Error",
      "message": "EROFS: read-only file system, chmod '/tmp/.mount_Unstop4VHdDq/resources/bin/tor'",
      "stack":
          Error: EROFS: read-only file system, chmod '/tmp/.mount_Unstop4VHdDq/resources/bin/tor'
      "errno": -30,
      "code": "EROFS",
      "syscall": "chmod",
      "path": "/tmp/.mount_Unstop4VHdDq/resources/bin/tor"
    }
[1726816756224] ERROR (8356 on EXAMPLE-ARCHLINUX-HOST): Failed to spawn tor
    torBinary: {
      "dirPath": "/tmp/.mount_Unstop4VHdDq/resources/bin",
      "fileName": "tor"
    }
    err: {
      "type": "Error",
      "message": "spawn ./tor ENOENT",
      "stack":
          Error: spawn ./tor ENOENT
              at Process.onexit (node:internal/child_process:283:19)
              at onErrorNT (node:internal/child_process:476:16)
              at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
      "errno": -2,
      "code": "ENOENT",
      "syscall": "spawn ./tor",
      "path": "./tor",
      "spawnargs": []
    }
[1726816756224] ERROR (8356 on EXAMPLE-ARCHLINUX-HOST): Failed to fully initiate app
    error: "Error: spawn ./tor ENOENT"
[1726816756384] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): CLI stdout
    subCommand: "start-daemon"
    data: "{\"timestamp\":\"2024-09-20T07:19:16.381795389Z\",\"level\":\"INFO\",\"fields\":{\"message\":\"Logging initialized to /home/EXAMPLE-USER/.local/share/xmr-btc-swap/cli/mainnet/logs\"}}\n"
[1726816756392] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): CLI stdout
    subCommand: "start-daemon"
    data: "{\"timestamp\":\"2024-09-20T07:19:16.391892801Z\",\"level\":\"DEBUG\",\"fields\":{\"message\":\"Reading in seed from /home/EXAMPLE-USER/.local/share/xmr-btc-swap/cli/mainnet/seed.pem\"}}\n"
[1726816756418] INFO (8356 on EXAMPLE-ARCHLINUX-HOST): Connected to UnstoppableSwap Socket API
    host: "api.unstoppableswap.net"
    path: "/api/socket.io"
[1726816759156] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): CLI stdout
    subCommand: "start-daemon"
    data: "{\"timestamp\":\"2024-09-20T07:19:19.156375539Z\",\"level\":\"DEBUG\",\"fields\":{\"message\":\"RPC exec path: /home/EXAMPLE-USER/.local/share/xmr-btc-swap/cli/mainnet/monero/monero-wallet-rpc\"}}\n"
[1726816759264] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): CLI stdout
    subCommand: "start-daemon"
    data: "{\"timestamp\":\"2024-09-20T07:19:19.26390727Z\",\"level\":\"DEBUG\",\"fields\":{\"message\":\"RPC version output: Monero 'Fluorine Fermi' (v0.18.3.1-release)\\n\"}}\n{\"timestamp\":\"2024-09-20T07:19:19.264000034Z\",\"level\":\"DEBUG\",\"fields\":{\"message\":\"Starting monero-wallet-rpc\",\"daemon_address\":\"node.community.rino.io:18081\",\"port\":\"39131\"}}\n"
[1726816760997] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): CLI stdout
    subCommand: "start-daemon"
    data: "{\"timestamp\":\"2024-09-20T07:19:20.997739361Z\",\"level\":\"DEBUG\",\"fields\":{\"message\":\"Opened Monero wallet\",\"monero_wallet_name\":\"swap-tool-blockchain-monitoring-wallet\"}}\n"
[1726816770305] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): CLI stdout
    subCommand: "start-daemon"
    data: "{\"timestamp\":\"2024-09-20T07:19:30.305164586Z\",\"level\":\"DEBUG\",\"fields\":{\"message\":\"Using existing sqlite database.\"}}\n"
[1726816770848] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): CLI stdout
    subCommand: "start-daemon"
    data: "{\"timestamp\":\"2024-09-20T07:19:30.848527743Z\",\"level\":\"INFO\",\"fields\":{\"message\":\"Started RPC server\",\"addr\":\"0.0.0.0:1234\"},\"span\":{\"method_name\":\"StartDaemon\",\"name\":\"method\"},\"spans\":[{\"method_name\":\"StartDaemon\",\"name\":\"method\"}]}\n"
[1726816770864] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): Received RPC response (success)
    method: "get_history"
    params: {}
    response: {
      "jsonrpc": "2.0",
      "result": {
        "swaps": []
      },
      "id": "1f324cce-62ce-4a50-ad33-2f9881848e50"
    }
makeRpcRequest get_history: 15.005ms
[1726816770865] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): No swaps present in history, skipping swap info retrieval
[1726816772602] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): CLI stdout
    subCommand: "start-daemon"
    data: "{\"timestamp\":\"2024-09-20T07:19:32.601784051Z\",\"level\":\"INFO\",\"fields\":{\"message\":\"Checked Bitcoin balance\",\"balance\":\"0 BTC\"},\"span\":{\"method_name\":\"Balance\",\"name\":\"method\"},\"spans\":[{\"method_name\":\"Balance\",\"name\":\"method\"}]}\n"
makeRpcRequest get_bitcoin_balance: 1.738s
[1726816772603] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): Received RPC response (success)
    method: "get_bitcoin_balance"
    params: {
      "force_refresh": true
    }
    response: {
      "jsonrpc": "2.0",
      "result": {
        "balance": 0
      },
      "id": "00b8cf4a-c143-436b-a41d-2a42eba0a9f2"
    }
[1726816775229] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): Preventing Electron from quitting, stopping CLI, Tor and their child processes first
[1726816775264] INFO (8531 on EXAMPLE-ARCHLINUX-HOST): Force killed child cli process
[1726816775264] INFO (8356 on EXAMPLE-ARCHLINUX-HOST): Force killed cli
    rootPid: 8458
[1726816775265] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): Preventing Electron from quitting, stopping CLI, Tor and their child processes first
[1726816775281] INFO (8356 on EXAMPLE-ARCHLINUX-HOST): CLI excited
    subCommand: "start-daemon"
    code: null
    signal: "SIGTERM"
[1726816775300] ERROR (8458 on EXAMPLE-ARCHLINUX-HOST): Failed to get children cli processes
    err: {
      "type": "Error",
      "message": "No matching pid found",
      "stack":
          Error: No matching pid found
              at /tmp/.mount_Unstop4VHdDq/resources/app.asar/dist/main/main.js:2:602172
              at /tmp/.mount_Unstop4VHdDq/resources/app.asar/dist/main/main.js:2:602696
              at ChildProcess.<anonymous> (/tmp/.mount_Unstop4VHdDq/resources/app.asar/dist/main/main.js:2:601134)
              at ChildProcess.emit (node:events:513:28)
              at maybeClose (node:internal/child_process:1091:16)
              at Process.onexit (node:internal/child_process:302:5)
    }
[1726816775301] ERROR (8458 on EXAMPLE-ARCHLINUX-HOST): Failed to kill root cli process
    err: {
      "type": "Error",
      "message": "kill ESRCH",
      "stack":
          Error: kill ESRCH
              at process.kill (node:internal/process/per_thread:233:13)
              at t.stopCli (/tmp/.mount_Unstop4VHdDq/resources/app.asar/dist/main/main.js:2:800820)
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
              at async App.<anonymous> (/tmp/.mount_Unstop4VHdDq/resources/app.asar/dist/main/main.js:2:813301)
      "errno": -3,
      "code": "ESRCH",
      "syscall": "kill"
    }
[1726816775301] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): Preventing Electron from quitting, stopping CLI, Tor and their child processes first
[1726816775333] DEBUG (8356 on EXAMPLE-ARCHLINUX-HOST): Attempted to kill monero-wallet-rpc using command
    stderr: ""
    stdout: ""
[1726816775334] WARN (8356 on EXAMPLE-ARCHLINUX-HOST): swapProcessExited called on a swap that is not running
[1726816775334] ERROR (8356 on EXAMPLE-ARCHLINUX-HOST): RPC server has stopped with code null
[1726816775335] ERROR (8458 on EXAMPLE-ARCHLINUX-HOST): Failed to get children cli processes
    err: {
      "type": "Error",
      "message": "No matching pid found",
      "stack":
          Error: No matching pid found
              at /tmp/.mount_Unstop4VHdDq/resources/app.asar/dist/main/main.js:2:602172
              at /tmp/.mount_Unstop4VHdDq/resources/app.asar/dist/main/main.js:2:602696
              at ChildProcess.<anonymous> (/tmp/.mount_Unstop4VHdDq/resources/app.asar/dist/main/main.js:2:601134)
              at ChildProcess.emit (node:events:513:28)
              at maybeClose (node:internal/child_process:1091:16)
              at Socket.<anonymous> (node:internal/child_process:449:11)
              at Socket.emit (node:events:513:28)
              at Pipe.<anonymous> (node:net:322:12)
    }
[1726816775336] ERROR (8458 on EXAMPLE-ARCHLINUX-HOST): Failed to kill root cli process
    err: {
      "type": "Error",
      "message": "kill ESRCH",
      "stack":
          Error: kill ESRCH
              at process.kill (node:internal/process/per_thread:233:13)
              at t.stopCli (/tmp/.mount_Unstop4VHdDq/resources/app.asar/dist/main/main.js:2:800820)
              at async App.<anonymous> (/tmp/.mount_Unstop4VHdDq/resources/app.asar/dist/main/main.js:2:813301)
      "errno": -3,
      "code": "ESRCH",
      "syscall": "kill"
    }
[1726816775336] INFO (8356 on EXAMPLE-ARCHLINUX-HOST): Letting Electron quit, there are no running child processes
symb10sis commented 1 week ago

After I looked a bit more into the issue, it seems that some of the errors are missleading.

Permission error when running chmod

The following errors seem not to be an issue and should not produce an error:

ERROR (8356 on EXAMPLE-ARCHLINUX-HOST): Failed to make swap binary executable

Reason for this is, that AppImages always get mounted as read-only filesystems under /tmp and because of this, it will never be possible to change the permissions of the executables in the AppImage. Looking at the permissions by mounting the AppImage, we can see that the binaries (0_13_4_swap and tor) are already executable and this "chmod" step could be skipped:

[EXAMPLE-USER@EXAMPLE-ARCHLINUX-HOST Downloads]$ ./UnstoppableSwap-0.6.3.AppImage --appimage-mount
/tmp/.mount_UnstoppbCIYX

[EXAMPLE-USER@EXAMPLE-ARCHLINUX-HOST tmp]$ ls -l .mount_UnstoppbCIYX/resources/bin/
total 65279
-rwxr-xr-x 1 root root 48034272 25. Jul 23:32 0_13_4_swap
-rw-r--r-- 1 root root  4064462  1. Aug 18:46 geoip
-rw-r--r-- 1 root root  6278782  1. Aug 18:46 geoip6
-rw-r--r-- 1 root root  2999064  1. Aug 18:46 libcrypto.so.1.1
-rw-r--r-- 1 root root   390888  1. Aug 18:46 libevent-2.1.so.7
-rw-r--r-- 1 root root   631160  1. Aug 18:46 libssl.so.1.1
drwxr-xr-x 2 root root        0  1. Aug 18:54 libstdc++
drwxr-xr-x 2 root root        0  1. Aug 18:54 PluggableTransports
-rwxr-xr-x 1 root root  4448028  1. Aug 18:46 tor
-rw-r--r-- 1 root root      834  1. Aug 18:46 torrc-defaults

To solve this a check could be implemented, which looks if those binaries already have the exectuable bit set before trying to make them executable.

kill error of monero-wallet-rpc

The following error gets produced because of a missing argument when calling kill using xargs.

[1726816756190] ERROR (8356 on EXAMPLE-ARCHLINUX-HOST): Attempted monero-wallet-rpc kill using command failed
    e: {
      "code": 123,
      "killed": false,
      "signal": null,
      "cmd": "ps aux | grep 'monero-wallet-rpc' | grep -v 'grep' | awk '{print $2}' | xargs kill -9",
      "stdout": "",
      "stderr": "kill: not enough arguments\n"
    }

When using kill with options (e.g. -9) then the argument of the pid to kill can't be provided via stdin without using the -I option of xargs.

To solve this using the current code, it should look like the following (but there is a cleaner way to do this, please see the next example):

ps aux | grep 'monero-wallet-rpc' | grep -v 'grep' | awk '{print $2}' | xargs -I{} kill -9 {}

Cleaner example:

pkill -9 'monero-wallet-rpc'
binarybaron commented 1 week ago

After I looked a bit more into the issue, it seems that some of the errors are missleading.

Permission error when running chmod

The following errors seem not to be an issue and should not produce an error:

ERROR (8356 on EXAMPLE-ARCHLINUX-HOST): Failed to make swap binary executable

Reason for this is, that AppImages always get mounted as read-only filesystems under /tmp and because of this, it will never be possible to change the permissions of the executables in the AppImage. Looking at the permissions by mounting the AppImage, we can see that the binaries (0_13_4_swap and tor) are already executable and this "chmod" step could be skipped:

[EXAMPLE-USER@EXAMPLE-ARCHLINUX-HOST Downloads]$ ./UnstoppableSwap-0.6.3.AppImage --appimage-mount
/tmp/.mount_UnstoppbCIYX

[EXAMPLE-USER@EXAMPLE-ARCHLINUX-HOST tmp]$ ls -l .mount_UnstoppbCIYX/resources/bin/
total 65279
-rwxr-xr-x 1 root root 48034272 25. Jul 23:32 0_13_4_swap
-rw-r--r-- 1 root root  4064462  1. Aug 18:46 geoip
-rw-r--r-- 1 root root  6278782  1. Aug 18:46 geoip6
-rw-r--r-- 1 root root  2999064  1. Aug 18:46 libcrypto.so.1.1
-rw-r--r-- 1 root root   390888  1. Aug 18:46 libevent-2.1.so.7
-rw-r--r-- 1 root root   631160  1. Aug 18:46 libssl.so.1.1
drwxr-xr-x 2 root root        0  1. Aug 18:54 libstdc++
drwxr-xr-x 2 root root        0  1. Aug 18:54 PluggableTransports
-rwxr-xr-x 1 root root  4448028  1. Aug 18:46 tor
-rw-r--r-- 1 root root      834  1. Aug 18:46 torrc-defaults

To solve this a check could be implemented, which looks if those binaries already have the exectuable bit set before trying to make them executable.

kill error of monero-wallet-rpc

The following error gets produced because of a missing argument when calling kill using xargs.

[1726816756190] ERROR (8356 on EXAMPLE-ARCHLINUX-HOST): Attempted monero-wallet-rpc kill using command failed
    e: {
      "code": 123,
      "killed": false,
      "signal": null,
      "cmd": "ps aux | grep 'monero-wallet-rpc' | grep -v 'grep' | awk '{print $2}' | xargs kill -9",
      "stdout": "",
      "stderr": "kill: not enough arguments\n"
    }

When using kill with options (e.g. -9) then the argument of the pid to kill can't be provided via stdin without using the -I option of xargs.

To solve this using the current code, it should look like the following (but there is a cleaner way to do this, please see the next example):

ps aux | grep 'monero-wallet-rpc' | grep -v 'grep' | awk '{print $2}' | xargs -I{} kill -9 {}

Cleaner example:

pkill -9 'monero-wallet-rpc'

Thank you for the write up. I'll look into it.

To clarify, these errors should not prevent the GUI from being used. The GUI should still function correctly. The daemon should still start correctly. Is that the case for you?

symb10sis commented 2 days ago

After I looked a bit more into the issue, it seems that some of the errors are missleading.

Permission error when running chmod

The following errors seem not to be an issue and should not produce an error:

ERROR (8356 on EXAMPLE-ARCHLINUX-HOST): Failed to make swap binary executable

Reason for this is, that AppImages always get mounted as read-only filesystems under /tmp and because of this, it will never be possible to change the permissions of the executables in the AppImage. Looking at the permissions by mounting the AppImage, we can see that the binaries (0_13_4_swap and tor) are already executable and this "chmod" step could be skipped:

[EXAMPLE-USER@EXAMPLE-ARCHLINUX-HOST Downloads]$ ./UnstoppableSwap-0.6.3.AppImage --appimage-mount
/tmp/.mount_UnstoppbCIYX

[EXAMPLE-USER@EXAMPLE-ARCHLINUX-HOST tmp]$ ls -l .mount_UnstoppbCIYX/resources/bin/
total 65279
-rwxr-xr-x 1 root root 48034272 25. Jul 23:32 0_13_4_swap
-rw-r--r-- 1 root root  4064462  1. Aug 18:46 geoip
-rw-r--r-- 1 root root  6278782  1. Aug 18:46 geoip6
-rw-r--r-- 1 root root  2999064  1. Aug 18:46 libcrypto.so.1.1
-rw-r--r-- 1 root root   390888  1. Aug 18:46 libevent-2.1.so.7
-rw-r--r-- 1 root root   631160  1. Aug 18:46 libssl.so.1.1
drwxr-xr-x 2 root root        0  1. Aug 18:54 libstdc++
drwxr-xr-x 2 root root        0  1. Aug 18:54 PluggableTransports
-rwxr-xr-x 1 root root  4448028  1. Aug 18:46 tor
-rw-r--r-- 1 root root      834  1. Aug 18:46 torrc-defaults

To solve this a check could be implemented, which looks if those binaries already have the exectuable bit set before trying to make them executable.

kill error of monero-wallet-rpc

The following error gets produced because of a missing argument when calling kill using xargs.

[1726816756190] ERROR (8356 on EXAMPLE-ARCHLINUX-HOST): Attempted monero-wallet-rpc kill using command failed
    e: {
      "code": 123,
      "killed": false,
      "signal": null,
      "cmd": "ps aux | grep 'monero-wallet-rpc' | grep -v 'grep' | awk '{print $2}' | xargs kill -9",
      "stdout": "",
      "stderr": "kill: not enough arguments\n"
    }

When using kill with options (e.g. -9) then the argument of the pid to kill can't be provided via stdin without using the -I option of xargs. To solve this using the current code, it should look like the following (but there is a cleaner way to do this, please see the next example):

ps aux | grep 'monero-wallet-rpc' | grep -v 'grep' | awk '{print $2}' | xargs -I{} kill -9 {}

Cleaner example:

pkill -9 'monero-wallet-rpc'

Thank you for the write up. I'll look into it.

To clarify, these errors should not prevent the GUI from being used. The GUI should still function correctly. The daemon should still start correctly. Is that the case for you?

Yes, the GUI and the swap daemon starts and can be used but the tor daemon can't be started. When trying to start the tor daemon in the settings, I receive the following erros:

[1727519147665] ERROR (35463 on EXAMPLE-ARCHLINUX-HOST): Failed to make tor binary executable
    torBinary: {
      "dirPath": "/tmp/.mount_UnstopSnSTrZ/resources/bin",
      "fileName": "tor"
    }
    err: {
      "type": "Error",
      "message": "EROFS: read-only file system, chmod '/tmp/.mount_UnstopSnSTrZ/resources/bin/tor'",
      "stack":
          Error: EROFS: read-only file system, chmod '/tmp/.mount_UnstopSnSTrZ/resources/bin/tor'
      "errno": -30,
      "code": "EROFS",
      "syscall": "chmod",
      "path": "/tmp/.mount_UnstopSnSTrZ/resources/bin/tor"
    }
Error occurred in handler for 'spawn-tor': Error: spawn ./tor ENOENT
    at Process.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn ./tor',
  path: './tor',
  spawnargs: []
}
[1727519147677] ERROR (35463 on EXAMPLE-ARCHLINUX-HOST: Failed to spawn tor
    torBinary: {
      "dirPath": "/tmp/.mount_UnstopSnSTrZ/resources/bin",
      "fileName": "tor"
    }
    err: {
      "type": "Error",
      "message": "spawn ./tor ENOENT",
      "stack":
          Error: spawn ./tor ENOENT
              at Process.onexit (node:internal/child_process:283:19)
              at onErrorNT (node:internal/child_process:476:16)
              at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
      "errno": -2,
      "code": "ENOENT",
      "syscall": "spawn ./tor",
      "path": "./tor",
      "spawnargs": []
    }