Sheherezadhe / awair-uploader

GNU General Public License v3.0
121 stars 57 forks source link

running under linux error #12

Open edradev opened 2 years ago

edradev commented 2 years ago

Installed normal, but after start, got error message:

user@:~/awair-uploader-1.0$ sudo npm start

awair-uploader@0.0.1 start electron-forge start

✔ Checking your system ✔ Locating Application ✔ Preparing native dependencies ✔ Compiling Main Process Code ✔ Launch Dev Servers ✔ Compiling Preload Scripts ✔ Launching Application

Webpack Output Available: http://localhost:9000

⠧ Compiling Renderer Codeuser@:~/awair-uploader-1.0$ (node:9014) UnhandledPromiseRejectionWarning: RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 9014. at /home/user/awair-uploader-1.0/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:47:47 at processTicksAndRejections (internal/process/task_queues.js:83:21) (node:9014) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:9014) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

pete-leese commented 2 years ago

yep also getting this error:

Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye

node:1468760) UnhandledPromiseRejectionWarning: RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 1468760. at /home/pete/awair-uploader/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:47:47 at processTicksAndRejections (internal/process/task_queues.js:83:21) (node:1468760) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:1468760) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:1468759) UnhandledPromiseRejectionWarning: RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 1468759. at /home/pete/awair-uploader/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:47:47 at processTicksAndRejections (internal/process/task_queues.js:83:21) (node:1468759) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:1468759) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

wgltony commented 2 years ago

Same error.

Sheherezadhe commented 2 years ago

I only barely last minute managed to make it run on Windows and macOS. Sorry guys I am at my limit at this moment, I need some rest.

It is all explained in the reddit post: https://www.reddit.com/r/PlanetWatchers/comments/tscbe3/project_awair_element_user_data_retrieval/

cflinspach commented 2 years ago

Using

# Install NodeJs
# Reference: https://github.com/nodesource/distributions/blob/master/README.md#debinstall
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs libatk1.0-0 libatk-bridge2.0-0 libcups2 libgtk-3-0 libgbm1

wget https://github.com/Sheherezadhe/awair-uploader/archive/refs/tags/v1.0.zip
unzip v1.0.zip
cd awair-uploader-1.0
npm install -g electron --unsafe-perm=true
npm install

On a fresh Ubuntu 20 got me:

~/awair/awair-uploader-1.0$ npm start

> awair-uploader@0.0.1 start
> electron-forge start

✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies
✔ Compiling Main Process Code
✔ Launch Dev Servers
✔ Compiling Preload Scripts
✔ Launching Application

Webpack Output Available: http://localhost:9000

⠴ Compiling Renderer Code node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 414859.
    at /home/ubuntu/awair/awair-uploader-1.0/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:47:47
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  code: undefined,
  signal: undefined
}
shadylanebees commented 2 years ago

Not sure if this helps. I compiled it on ubuntu 20.04 with:

npm run make

Then run the application in: awair-uploader/out/awair-uploader-linux-x64

So far it seems to be working when I cd to out/awair-uploader-linux-x64 and run ./awair-uploader

Wouldn't mind a shell only version, this is running through a chrome sandbox instance

Warmduscher commented 2 years ago

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -

I used node.js 14 and it started without complains

cflinspach commented 2 years ago

I downgraded to 14 and am still getting RpcIpcMessagePortClosedError

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
[sudo] password for user: 

## Installing the NodeSource Node.js 14.x repo...

## Populating apt-get cache...

+ apt-get update
Hit:1 https://deb.nodesource.com/node_16.x focal InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [1,704 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu focal-updates/main Translation-en [319 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [913 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [130 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [915 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu focal-security/main Translation-en [238 kB]
Fetched 4,556 kB in 2s (2,239 kB/s)                           
Reading package lists... Done

## Confirming "focal" is supported...

+ curl -sLf -o /dev/null 'https://deb.nodesource.com/node_14.x/dists/focal/Release'

## Adding the NodeSource signing key to your keyring...

+ curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee /usr/share/keyrings/nodesource.gpg >/dev/null

## Creating apt sources list file for the NodeSource Node.js 14.x repo...

+ echo 'deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x focal main' > /etc/apt/sources.list.d/nodesource.list
+ echo 'deb-src [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_14.x focal main' >> /etc/apt/sources.list.d/nodesource.list

## Running `apt-get update` for you...

+ apt-get update
Hit:1 http://us.archive.ubuntu.com/ubuntu focal InRelease
Get:2 https://deb.nodesource.com/node_14.x focal InRelease [4,583 B]
Hit:3 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:5 http://us.archive.ubuntu.com/ubuntu focal-security InRelease
Get:6 https://deb.nodesource.com/node_14.x focal/main amd64 Packages [775 B]
Fetched 5,358 B in 1s (6,903 B/s)
Reading package lists... Done

## Run `sudo apt-get install -y nodejs` to install Node.js 14.x and npm
## You may also need development tools to build native addons:
     sudo apt-get install gcc g++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | sudo tee /usr/share/keyrings/yarnkey.gpg >/dev/null
     echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn

user@ubuntu:~$ sudo apt-get install nodejs=1
10.19.0~dfsg-3ubuntu1     14.19.1-deb-1nodesource1  
user@ubuntu:~$ sudo apt-get install nodejs=14.19.1-deb-1nodesource1 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfwupdplugin1
Use 'sudo apt autoremove' to remove it.
The following packages will be DOWNGRADED:
  nodejs
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 25.4 MB of archives.
After this operation, 1,553 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
Get:1 https://deb.nodesource.com/node_14.x focal/main amd64 nodejs amd64 14.19.1-deb-1nodesource1 [25.4 MB]
Fetched 25.4 MB in 6s (4,290 kB/s) 
dpkg: warning: downgrading nodejs from 16.14.2-deb-1nodesource1 to 14.19.1-deb-1nodesource1
(Reading database ... 162777 files and directories currently installed.)
Preparing to unpack .../nodejs_14.19.1-deb-1nodesource1_amd64.deb ...
Unpacking nodejs (14.19.1-deb-1nodesource1) over (16.14.2-deb-1nodesource1) ...
Setting up nodejs (14.19.1-deb-1nodesource1) ...
Processing triggers for man-db (2.9.1-1) ...
user@ubuntu:~$ cd awair/awair-uploader-1.0/
user@ubuntu:~/awair/awair-uploader-1.0$ ls
LICENSE       package.json       src                     webpack.plugins.js
node_modules  package-lock.json  tsconfig.json           webpack.renderer.config.js
out           README.md          webpack.main.config.js  webpack.rules.js
user@ubuntu:~/awair/awair-uploader-1.0$ rm -rf node_modules/
user@ubuntu:~/awair/awair-uploader-1.0$ npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!

> lzma-native@8.0.6 install /home/user/awair/awair-uploader-1.0/node_modules/lzma-native
> node-gyp-build

> electron-winstaller@5.0.0 install /home/user/awair/awair-uploader-1.0/node_modules/electron-winstaller
> node ./script/select-7z-arch.js

Selecting 7-Zip for arch x64

> core-js-pure@3.21.1 postinstall /home/user/awair/awair-uploader-1.0/node_modules/core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js:
> https://opencollective.com/core-js 
> https://patreon.com/zloirock 
> https://paypal.me/zloirock 
> bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> electron@16.0.7 postinstall /home/user/awair/awair-uploader-1.0/node_modules/electron
> node install.js

npm WARN awair-uploader@0.0.1 No repository field.
npm WARN awair-uploader@0.0.1 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: appdmg@0.6.4 (node_modules/appdmg):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for appdmg@0.6.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 1259 packages from 842 contributors and audited 1291 packages in 38.273s

152 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

user@ubuntu:~/awair/awair-uploader-1.0$ npm start

> awair-uploader@0.0.1 start /home/user/awair/awair-uploader-1.0
> electron-forge start

✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies
✔ Compiling Main Process Code
✔ Launch Dev Servers
✔ Compiling Preload Scripts
✔ Launching Application

Webpack Output Available: http://localhost:9000

⠴ Compiling Renderer Codeuser@ubuntu:~/awair/awair-uploader-1.0$ (node:421001) UnhandledPromiseRejectionWarning: RpcIpcMessagePortClosedError: Cannot send the message - the message port has been closed for the process 421001.
    at /home/user/awair/awair-uploader-1.0/node_modules/fork-ts-checker-webpack-plugin/lib/rpc/rpc-ipc/RpcIpcMessagePort.js:47:47
    at processTicksAndRejections (internal/process/task_queues.js:81:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:421001) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:421001) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Netstat:

netstat -tulnp 
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -                   
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -                   
tcp        0      0 127.0.0.1:4280          0.0.0.0:*               LISTEN      -                   
tcp6       0      0 :::22                   :::*                    LISTEN      -                   
tcp6       0      0 :::4281                 :::*                    LISTEN      -                   
tcp6       0      0 :::4282                 :::*                    LISTEN      -                   
tcp6       0      0 :::4283                 :::*                    LISTEN      -                   
tcp6       0      0 :::4284                 :::*                    LISTEN      -                   
tcp6       0      0 :::4285                 :::*                    LISTEN      -                   
udp        0      0 127.0.0.53:53           0.0.0.0:*                           -                   
udp        0      0 192.168.0.81:68         0.0.0.0:* 
edradev commented 2 years ago

Not sure if this helps. I compiled it on ubuntu 20.04 with:

npm run make

Then run the application in: awair-uploader/out/awair-uploader-linux-x64

So far it seems to be working when I cd to out/awair-uploader-linux-x64 and run ./awair-uploader

Wouldn't mind a shell only version, this is running through a chrome sandbox instance

I want shell only version without GUI?

nicolasevigo commented 2 years ago

Not sure if this helps. I compiled it on ubuntu 20.04 with:

npm run make

Then run the application in: awair-uploader/out/awair-uploader-linux-x64

So far it seems to be working when I cd to out/awair-uploader-linux-x64 and run ./awair-uploader

Wouldn't mind a shell only version, this is running through a chrome sandbox instance

This worked for me, had to install rpm and a few other dependencies but the errors guided me

Warmduscher commented 2 years ago

@cflinspach i did from a clean Ubuntu LTS 20:

sudo apt-get --assume-yes install curl
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get --assume-yes install git nodejs
git clone https://github.com/Sheherezadhe/awair-uploader.git
cd awair-uploader
npm install

and then npm start resulted in:

> awair-uploader@0.0.1 start /home/nookie/awair-uploader
> electron-forge start

✔ Checking your system
✔ Locating Application
✔ Preparing native dependencies
✔ Compiling Main Process Code
✔ Launch Dev Servers
✔ Compiling Preload Scripts
✔ Launching Application

Webpack Output Available: http://localhost:9000

⠧ Compiling Renderer Code[15801:0402/163132.286184:ERROR:viz_main_impl.cc(161)] Exiting GPU process due to errors during initialization
[15846:0402/163132.411062:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
[15814:0402/163132.435060:ERROR:command_buffer_proxy_impl.cc(125)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
⠏ Compiling Renderer Codeasset main_window/index.js 20.2 MiB [emitted] (name: main_window)
asset main_window/index.html 183 bytes [emitted]
runtime modules 26.8 KiB 14 modules
orphan modules 15.9 KiB [orphan] 10 modules
modules by path ./node_modules/ 6.67 MiB 1096 modules
modules by path ./src/ 72.4 KiB
  modules by path ./src/components/ 38.9 KiB 18 modules
  modules by path ./src/*.ts 9.97 KiB 4 modules
  modules by path ./src/*.css 6.11 KiB 4 modules
  modules by path ./src/pages/ 4.57 KiB 3 modules
  modules by path ./src/*.tsx 4.52 KiB 2 modules
  modules by path ./src/utils/ 4.01 KiB 2 modules
  modules by path ./src/services/*.ts 3.37 KiB 2 modules
  ./src/features/auth/AuthSlice.ts 694 bytes [built] [code generated]
  ./src/mappers/AwairToPlanetWatchMapper.ts 302 bytes [built] [code generated]
data:image/svg+xml;base64,PHN2ZyB3aWR0aD0i.. 658 bytes [built] [code generated]
webpack 5.71.0 compiled successfully in 6141 ms
✔ Compiling Renderer Code
No issues found.
http://localhost:33333/keycloak-redirect#error=login_required&state=faad1f5b-4f81-4768-88c7-66e642763758
#error=login_required&state=faad1f5b-4f81-4768-88c7-66e642763758
http://localhost:3000/main_window#error=login_required&state=faad1f5b-4f81-4768-88c7-66e642763758

still not working as intended, but without the error you have.

cflinspach commented 2 years ago

Do you have a monitor attached @Warmduscher ?

Warmduscher commented 2 years ago

@cflinspach It's a virtual machine under VMWare Workstation

pwestbro commented 2 years ago

Not sure if this helps. I compiled it on ubuntu 20.04 with:

npm run make

Then run the application in: awair-uploader/out/awair-uploader-linux-x64

So far it seems to be working when I cd to out/awair-uploader-linux-x64 and run ./awair-uploader

Wouldn't mind a shell only version, this is running through a chrome sandbox instance

Thank you, this worked for me as well. I am running this in a VNC session on my linux machine, so the lack of the shell only version isn't too urgent for me.

Thank you @Sheherezadhe for creating this tool

shadylanebees commented 2 years ago

I am finding that you need to restart the application after 24 hours .. seems PlanetWatch is wanting us to re-login.

See this thread: https://github.com/Sheherezadhe/awair-uploader/issues/36