asticode/go-astilectron

centos7 gui start fail logs as creating window failed: context canceled

baerwang opened this issue · 2 comments

log output

2022/05/16 07:48:55 astikit: starting worker...
2022/05/16 07:48:55 Starting...
2022/05/16 07:48:55 Provisioning...
2022/05/16 07:48:55 Astilectron has already been provisioned to version 0.51.0, moving on...
2022/05/16 07:48:55 Electron has already been provisioned to version 11.4.3, moving on...
2022/05/16 07:48:55 Listening...
2022/05/16 07:48:55 Executing...
2022/05/16 07:48:55 Starting cmd /root/Desktop/bas_agent_linux/resources/vendor/electron-linux-amd64/electron /root/Desktop/bas_agent_linux/resources/vendor/astilectron/main.js 127.0.0.1:34423 true
2022/05/16 07:48:55 Stderr says: [56049:0516/074855.342159:FATAL:electron_main_delegate.cc(253)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
2022/05/16 07:48:55 '/root/Desktop/bas_agent_linux/resources/vendor/electron-linux-amd64/electron' exited with code: -1
2022/05/16 07:48:55 App has crashed
2022/05/16 07:48:55 Stopping...
2022/05/16 07:48:55 astikit: stopping worker...
2022/05/16 07:48:55 Closing...
2022/05/16 07:48:55 accept tcp 127.0.0.1:34423: use of closed network connection while TCP accepting
2022/05/16 07:48:55 Stopping...
panic: creating window failed: context canceled

goroutine 1 [running]:
main.main()

how to use use build to compile add --no-sandbox

astilectron.Options{ElectronSwitches:   []string{"--no-sandbox"}}