Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors while setting up on MacOS #6

Closed
web3tard opened this issue Oct 29, 2023 · 20 comments
Closed

Errors while setting up on MacOS #6

web3tard opened this issue Oct 29, 2023 · 20 comments
Labels
bug Something isn't working

Comments

@web3tard
Copy link

web3tard commented Oct 29, 2023

There are two errors when trying to install on MacOS (14.1, running on Silicon M1 pro macbook).

  • First, the edge cli can't be downloaded correctly.

Log messages say:

29 October 2023 09:13:07.402 UTC Awaiting initial command...
29 October 2023 09:13:07.402 UTC Created default config.
29 October 2023 09:28:20.912 UTC Derived binary name edge.exe based on network mainnet
29 October 2023 09:28:20.913 UTC Derived binary name edge.exe based on network mainnet
29 October 2023 09:28:20.913 UTC Derived binary name edge.exe based on network mainnet
29 October 2023 09:28:21.035 UTC Download Url: https://files.edge.network/cli/mainnet/macos/x64/latest/edge.exe
29 October 2023 09:28:21.035 UTC Preparing to download https://files.edge.network/cli/mainnet/macos/x64/latest/edge.exe to /Users/max/Library/Application Support/EdgeStakingGUI/edge.exe.
29 October 2023 09:28:21.498 UTC Download Headers: {
    "server": "nginx/1.25.2",
    "date": "Sun, 29 Oct 2023 09:28:21 GMT",
    "content-type": "text/html",
    "content-length": "453",
    "connection": "keep-alive",
    "last-modified": "Mon, 09 Jan 2023 16:47:17 GMT",
    "etag": "\"1c5-5f1d7851baf40\"",
    "accept-ranges": "bytes",
    "strict-transport-security": "max-age=31536000",
}
29 October 2023 09:28:21.498 UTC Opening file: /Users/max/Library/Application Support/EdgeStakingGUI/edge.exe. Program may be temporarily unresponsive while writing.
29 October 2023 09:28:21.499 UTC Downloading file: https://files.edge.network/cli/mainnet/macos/x64/latest/edge.exe to /Users/max/Library/Application Support/EdgeStakingGUI/edge.exe. Downloaded 453 / 453 bytes
29 October 2023 09:28:21.499 UTC File downloaded: https://files.edge.network/cli/mainnet/macos/x64/latest/edge.exe !
29 October 2023 09:28:21.499 UTC Derived binary name edge.exe based on network mainnet
29 October 2023 09:28:21.560 UTC Downloading checksum from URL: https://files.edge.network/cli/mainnet/macos/x64/latest/checksum
29 October 2023 09:28:21.560 UTC Preparing to download https://files.edge.network/cli/mainnet/macos/x64/latest/checksum to /Users/max/Library/Application Support/EdgeStakingGUI/checksum.
29 October 2023 09:28:21.829 UTC Download Headers: {
    "server": "nginx/1.25.2",
    "date": "Sun, 29 Oct 2023 09:28:21 GMT",
    "content-length": "64",
    "connection": "keep-alive",
    "last-modified": "Tue, 15 Aug 2023 14:48:27 GMT",
    "etag": "\"40-602f7458a2b5a\"",
    "accept-ranges": "bytes",
    "strict-transport-security": "max-age=31536000",
}
29 October 2023 09:28:21.832 UTC Opening file: /Users/max/Library/Application Support/EdgeStakingGUI/checksum. Program may be temporarily unresponsive while writing.
29 October 2023 09:28:21.834 UTC Downloading file: https://files.edge.network/cli/mainnet/macos/x64/latest/checksum to /Users/max/Library/Application Support/EdgeStakingGUI/checksum. Downloaded 64 / 64 bytes
29 October 2023 09:28:21.835 UTC File downloaded: https://files.edge.network/cli/mainnet/macos/x64/latest/checksum !
29 October 2023 09:28:21.835 UTC File was not downloaded correctly. Attempting to remove automatically.
29 October 2023 09:28:21.836 UTC Removed incorrect downloaded file automatically.

  • Second, the docker check fails even though it is installed and running.
    Log messages:
29 October 2023 09:29:01.251 UTC Checking if Docker is installed & running correctly
29 October 2023 09:29:01.252 UTC Is Docker installed & did you restart your computer? Docker installation link: https://www.docker.com/products/docker-desktop/ Error = No such file or directory (os error 2)
29 October 2023 09:29:01.252 UTC ❌Is Docker installed & did you restart your computer? Docker installation link: https://www.docker.com/products/docker-desktop/ Error = No such file or directory (os error 2) | 
29 October 2023 09:29:01.252 UTC Checked requirements.
29 October 2023 09:29:01.252 UTC Requirements last checked on: 29 October 2023 09:29:01 UTC 
29 October 2023 09:29:01.252 UTC ❌Did not pass all requirements.
@PodTheCoder
Copy link
Owner

Thank you for the bug report!

Error 1 should be resolved in the new release. Binary naming issue; on Mac and Linux it is edge instead of edge.exe
c41a7f5

Regarding error 2, could you try running docker info in the terminal and show the result?

@web3tard
Copy link
Author

Sure

 Version:    24.0.6
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2-desktop.5
    Path:     /Users/max/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.23.0-desktop.1
    Path:     /Users/max/.docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /Users/max/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.20
    Path:     /Users/max/.docker/cli-plugins/docker-extension
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.9
    Path:     /Users/max/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/max/.docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     /Users/max/.docker/cli-plugins/docker-scan
  scout: Docker Scout (Docker Inc.)
    Version:  v1.0.9
    Path:     /Users/max/.docker/cli-plugins/docker-scout

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 24.0.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8165feabfdfe38c65b599c4993d227328c231fca
 runc version: v1.1.8-0-g82f18fe
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.4.16-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 10
 Total Memory: 7.661GiB
 Name: linuxkit-56e1832155d0
 ID: 9a1faa12-3d1e-4bc6-8744-f13d445cd7ad
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: daemon is not using the default seccomp profile

@PodTheCoder
Copy link
Owner

Troubleshooting

Terminal command docker info works -> Can already be found on PATH by the user.

Hypothesis

  • Rust inherits the environment from the parent process, PATH is not inherited by child process.

Fix

Explicitly define PATH environment. ce9bf04 Was unable to verify whether Mac OS stores binaries in $PATH/bin.

@maxxar92 Does release 0.9.7 fix the problem?

Alternative Hypothesis

  • Permission issue. Could be related to installer or at runtime.
  • Code signing issue on MacOS.

Alternative Fixes

@web3tard
Copy link
Author

The new release does not fix it, same output as before. I tried a short rust program from my terminal (run with cargo run) that prints out match Command::new("docker").arg("info").output() and that worked fine, so it must be something different. Maybe permission error since I'm only able to run the executable with explictly choosing to trust unidentified developer

@PodTheCoder
Copy link
Owner

No such file or directory (os error 2) still suggests it's a discoverability issue rather than a permission issue. Thanks also for testing out the Rust command on your system, this is very useful.

Found this thread about a known bug + fix in the frontend framework on MacOS & Linux. The tricky part of the bug is that it even works in dev, but not after build. tauri-apps/tauri#4788 63dcb0e

Also reverted the earlier attempted fix because the PATH env should already be available. "If program is not an absolute path, the PATH will be searched in an OS-defined way." & (https://doc.rust-lang.org/std/process/struct.Command.html#implementations) 8875e59

"I'm only able to run the executable with explicitly choosing to trust unidentified developer". I think this is related to code signing (similar to Microsoft Smartscreen warning): #7. It might have an impact on permissions too.

@web3tard
Copy link
Author

web3tard commented Oct 31, 2023

Thank you, that seems to have solved it. Now the next issue appears at the start node command:

31 October 2023 18:33:10.322 UTC Invoking command in Edge CLI = device stop --stake=0eac11f3ac59e232cbd42655946e384066a9b09558391117b48bd9fb3ae4d5fa
31 October 2023 18:33:10.323 UTC Command device stop --stake=0eac11f3ac59e232cbd42655946e384066a9b09558391117b48bd9fb3ae4d5fa did not complete successfully. Error = Permission denied (os error 13)
31 October 2023 18:33:10.323 UTC Command device stop --stake=0eac11f3ac59e232cbd42655946e384066a9b09558391117b48bd9fb3ae4d5fa did not complete successfully. Error = Permission denied (os error 13)
31 October 2023 18:33:10.323 UTC Could not start node. Make sure you have the latest CLI installed and that Docker is running. Then try again. If the error persists, contact support.
31 October 2023 18:33:16.120 UTC Derived index url https://index.xe.network based on network in config mainnet
31 October 2023 18:33:16.180 UTC Set stake ID in config: 0eac11f3ac59e232cbd42655946e384066a9b09558391117b48bd9fb3ae4d5fa
31 October 2023 18:33:16.183 UTC Checking if Operating System (OS) is supported
31 October 2023 18:33:16.216 UTC ✔️macos | 
31 October 2023 18:33:16.216 UTC Checking if processor is supported
31 October 2023 18:33:16.244 UTC ✔️x64 | 
31 October 2023 18:33:16.244 UTC Checking if Docker is installed & running correctly
31 October 2023 18:33:16.322 UTC Docker Exit code = 0
31 October 2023 18:33:16.322 UTC Docker installed & ready.
31 October 2023 18:33:16.322 UTC ✔️Docker installed & ready. | 
31 October 2023 18:33:16.322 UTC Checking if Edge is downloaded correctly
31 October 2023 18:33:16.347 UTC Derived binary name edge based on network mainnet
31 October 2023 18:33:16.392 UTC Downloading checksum from URL: https://files.edge.network/cli/mainnet/macos/x64/latest/checksum
31 October 2023 18:33:16.392 UTC Preparing to download https://files.edge.network/cli/mainnet/macos/x64/latest/checksum to /Users/max/Library/Application Support/EdgeStakingGUI/checksum.
31 October 2023 18:33:16.678 UTC Download Headers: {
    "server": "nginx/1.25.2",
    "date": "Tue, 31 Oct 2023 18:33:16 GMT",
    "content-length": "64",
    "connection": "keep-alive",
    "last-modified": "Tue, 15 Aug 2023 14:48:27 GMT",
    "etag": "\"40-602f7458a2b5a\"",
    "accept-ranges": "bytes",
    "strict-transport-security": "max-age=31536000",
}
31 October 2023 18:33:16.681 UTC Opening file: /Users/max/Library/Application Support/EdgeStakingGUI/checksum. Program may be temporarily unresponsive while writing.
31 October 2023 18:33:16.681 UTC Downloading file: https://files.edge.network/cli/mainnet/macos/x64/latest/checksum to /Users/max/Library/Application Support/EdgeStakingGUI/checksum. Downloaded 64 / 64 bytes
31 October 2023 18:33:16.682 UTC File downloaded: https://files.edge.network/cli/mainnet/macos/x64/latest/checksum !
31 October 2023 18:33:17.224 UTC CLI installed correctly!
31 October 2023 18:33:17.225 UTC ✔️Latest Edge CLI installed for your system.
31 October 2023 18:33:17.225 UTC Checked requirements.
31 October 2023 18:33:17.225 UTC Requirements last checked on: 31 October 2023 18:33:16 UTC 
31 October 2023 18:33:17.225 UTC ✔️Passed requirements.
31 October 2023 18:33:17.249 UTC Derived binary name edge based on network mainnet
31 October 2023 18:33:17.249 UTC Invoking command in Edge CLI = device stop --stake=0eac11f3ac59e232cbd42655946e384066a9b09558391117b48bd9fb3ae4d5fa
31 October 2023 18:33:17.249 UTC Command device stop --stake=0eac11f3ac59e232cbd42655946e384066a9b09558391117b48bd9fb3ae4d5fa did not complete successfully. Error = Permission denied (os error 13)
31 October 2023 18:33:17.249 UTC Command device stop --stake=0eac11f3ac59e232cbd42655946e384066a9b09558391117b48bd9fb3ae4d5fa did not complete successfully. Error = Permission denied (os error 13)
31 October 2023 18:33:17.251 UTC Could not start node. Make sure you have the latest CLI installed and that Docker is running. Then try again. If the error persists, contact support.

@PodTheCoder
Copy link
Owner

We're getting closer to solving the problem!

@maxxar92 Can you paste the permissions within the folder? I think these commands should work:

cd /Users/max/Library/Application Support/EdgeStakingGUI/ 
ls -l

Pre Analysis

The problem seems to be that the Rust backend has no permission to execute a command using the edge binary.

31 October 2023 18:33:16.322 UTC Checking if Edge is downloaded correctly
31 October 2023 18:33:16.347 UTC Derived binary name edge based on network mainnet
31 October 2023 18:33:16.392 UTC Downloading checksum from URL: https://files.edge.network/cli/mainnet/macos/x64/latest/checksum
31 October 2023 18:33:16.392 UTC Preparing to download https://files.edge.network/cli/mainnet/macos/x64/latest/checksum to /Users/max/Library/Application Support/EdgeStakingGUI/checksum.

First off, based on the snippet above we can eliminate potential problems:

  • Rust could download the CLI -> Has file open + write permissions. However, may not have execution permission.
  • Rust has the correct path to the binary because it can compare the checksums -> Not a binary path nor binary naming issue.
31 October 2023 18:33:17.249 UTC Command device stop --stake=0eac11f3ac59e232cbd42655946e384066a9b09558391117b48bd9fb3ae4d5fa did not complete successfully. Error = **Permission denied (os error 13)**

Furthermore, seeing device stop in the logs is expected behaviour when starting a node. This is done to ensure the node has the latest configuration.

It is possible to include binaries as part of a Tauri installation via a sidecar. Several users report Mac OS permission problems:
tauri-apps/tauri#4653 tauri-apps/tauri#7460

Relative paths can be problematic on MacOS. rust-lang/rust#80537 is no problem either because the path is absolute. rust-lang/rust#80819

However, the Edge Staking GUI works different because it always wants to download the latest appropriate
Edge CLI binary. The binary is downloaded to the Local App Data Dir. In your case this is: /Users/max/Library/Application Support/EdgeStakingGUI/

Hypothesis

On MacOS, the downloaded Edge CLI has no executable permissions set for the file owner.

Fix

After file is fully downloaded, explicitly set the file permissions.


https://doc.rust-lang.org/std/fs/struct.Permissions.html#implementations

Alternative Hypothesis

  • Program requires sudo permissions to execute programs. Doubt this hypothesis because it could run docker info in a previous step.
  • Not sure. Open to suggestions.

@web3tard
Copy link
Author

web3tard commented Oct 31, 2023

Sure:

(base) max@Maxs-MBP EdgeStakingGUI % ls -l
total 110688
-rw-r--r--@ 1 max  staff        64 Oct 31 19:33 checksum
-rw-r--r--@ 1 max  staff       439 Oct 31 19:33 config.txt
-rw-r--r--@ 1 max  staff  56608176 Oct 30 14:44 edge
-rw-r--r--@ 1 max  staff     49814 Oct 31 19:33 log.txt

Seems no x bit is set, yup. After doing a chmod +x I can execute the ./edge binary in the folder

@PodTheCoder
Copy link
Owner

That seems likely to be the problem.

After chmod +x, can you also double check if the GUI can run the Start Node ?

@web3tard
Copy link
Author

web3tard commented Oct 31, 2023

Yes, now it works 👍

@PodTheCoder
Copy link
Owner

Okay awesome, that seems to be the issue. Will prepare a fix.

Let me know if you get to the next screen in the GUI. It should show status messages similar to:

25 October 2023 21:47:21.177 UTC Your node was started successfully! Sit back and relax. The Staking GUI will automatically keep checking if your node is online.
25 October 2023 21:48:21.194 UTC Rechecking node online status. Count : 1
25 October 2023 21:48:21.200 UTC Derived index url https://index.xe.network based on network in config mainnet
25 October 2023 21:48:21.378 UTC Node is online.
25 October 2023 21:48:21.386 UTC Derived index url https://index.xe.network based on network in config mainnet
25 October 2023 21:48:21.530 UTC Set wallet address in config: xe_a2c8d5E90DB2505b23c7B95577f6D1ca2ca765b0
25 October 2023 21:48:21.540 UTC Wallet address derived based on node address:xe_a2c8d5E90DB2505b23c7B95577f6D1ca2ca765b0
25 October 2023 21:48:21.542 UTC Changed config initialization status to: true
25 October 2023 21:48:21.544 UTC :heavy_check_mark:Congratulations! Your device has fully started! You can now close the Staking GUI.

The screen looks like this:
image

I would also be interested to hear if notifications work properly + the buttons Enable Autostart and Enable Minimized.

@web3tard
Copy link
Author

The log and GUI look like that, yes 👍

I got a prompt about notifications from the program, that seems to have worked, I also got a notifications about that my node autostarted.

One remaining issue I noticed is a second application icon (the black dot) appearing the top left corner (a weird position for mac), even when the program is minimized and another is focused such as:
Screenshot 2023-10-31 at 22 52 26

@web3tard
Copy link
Author

Seems like a transient issue though, it vanishes as soon as I switch desktop views

@PodTheCoder
Copy link
Owner

PodTheCoder commented Oct 31, 2023

Regarding the log & GUI, that's great.

Attempted to create a permission fix as part of release 0.9.9. Don't have access to a Mac laptop so it feels like flying blind.
But I double checked the documentation and it should work.

You can test the fix by clicking the button Back to Setup & manually deleting the edge binary in /Users/max/Library/Application Support/EdgeStakingGUI/. Then proceeding as normally. Note that this is a complete reset so you will need to follow each step again.

@PodTheCoder
Copy link
Owner

In the log there should also be a new entry upon downloading the CLI:

"Set file {download_path} permissions to {0o744}"

OR

Could not set file {download_path} permissions to {0o744}. Err: {}"

@PodTheCoder
Copy link
Owner

Also to clarify for a complete reset you don't need to create a new host stake. You can reassign an existing one.

@PodTheCoder
Copy link
Owner

Technically it's possible to keep the data by setting initialized = false. It's a bit of a hassle, but Back To Setup most closely emulates a fresh reinstall (however it does not delete the volume edge-device-data which gets overwritten in step 3.)

@PodTheCoder
Copy link
Owner

@maxxar92 Hope the permission fix works upon a fresh setup.

"One remaining issue I noticed is a second application icon (the black dot) appearing the top left corner (a weird position for mac), even when the program is minimized and another is focused such as". Hmmm that's an interesting bug. Opened up a separate issue for it. #8

@web3tard
Copy link
Author

web3tard commented Nov 2, 2023

Yes, the fresh setup works also, thank you

@PodTheCoder PodTheCoder added the bug Something isn't working label Nov 2, 2023
@PodTheCoder
Copy link
Owner

Thanks for your help!
Closing because the original issues have been solved. For separate issues related to MacOS, please open a ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants