maple3142 / cf-warp

MIT License
449 stars 64 forks source link

ubuntu focal in oracle cloud , cf-warp run error #29

Closed changchichung closed 3 years ago

changchichung commented 3 years ago

OS: ubuntu 20.04 install cf-warp using npm i -g cf-warp , then run cf-warp will return error

cf-warp
Initializing Warp credentials...

(node:14589) UnhandledPromiseRejectionWarning: Error [ERR_SOCKET_CLOSED]: Socket is closed
    at TLSSocket.Socket._writeGeneric (net.js:704:18)
    at TLSSocket.connect (net.js:696:12)
    at Object.onceWrapper (events.js:286:20)
    at TLSSocket.emit (events.js:203:15)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:10)
(node:14589) 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(). (rejection id: 1)
(node:14589) [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.

download cli-linux then run cli-linux , there's another problem.

root@warp-cowbay-org:~/git/cf-warp# ./cli-linux 
Initializing Warp credentials...

(node:14614) UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token e in JSON at position 0
    at JSON.parse (<anonymous>)
    at /snapshot/cf-warp/lib/register.js
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async init (/snapshot/cf-warp/cli.js)
(node:14614) 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(). (rejection id: 1)
(node:14614) [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.
root@warp-cowbay-org:~/git/cf-warp# 
maple3142 commented 3 years ago

It works correctly here, maybe it has to do with the network environment. Maybe CloudFlare blocks ip from datacenter?

changchichung commented 3 years ago

so I try another PC with ubuntu 20.04 , still the same error

git clone

git clone https://github.com/maple3142/cf-warp
正複製到 'cf-warp'...
remote: Enumerating objects: 169, done.
remote: Counting objects: 100% (169/169), done.
remote: Compressing objects: 100% (128/128), done.
remote: Total 169 (delta 89), reused 107 (delta 38), pack-reused 0
接收物件中: 100% (169/169), 39.52 KiB | 1.72 MiB/s, 完成.
處理 delta 中: 100% (89/89), 完成.

install

chchang@hqdc039:~/git/cf-warp$ yarn global add cf-warp 
yarn global v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "cf-warp@1.4.0" with binaries:
      - cf-warp
Done in 1.60s.

running cf-warp

chchang@hqdc039:~/git/cf-warp$ cf-warp
Initializing Warp credentials...

(node:884275) UnhandledPromiseRejectionWarning: Error [ERR_SOCKET_CLOSED]: Socket is closed
    at TLSSocket.Socket._writeGeneric (net.js:704:18)
    at TLSSocket.connect (net.js:696:12)
    at Object.onceWrapper (events.js:286:20)
    at TLSSocket.emit (events.js:203:15)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1093:10)
(node:884275) 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(). (rejection id: 1)
(node:884275) [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.
chchang@hqdc039:~/git/cf-warp$ 
maple3142 commented 3 years ago

Just tested, docker works correctly. Maybe you can test it in docker? Not sure if this has to do with network problem or environment.

~                                                                                                           at 09:55:41
> docker run --rm -v ~/.cf-warp:/root/.cf-warp maple3142/cf-warp
Initializing Warp credentials...

Your Warp credentials are located at "/root/.cf-warp/data.json", and WireGuard connection file is "/root/.cf-warp/cf-warp.conf".
You currently have 0GB Warp+ quota.
To get your current Warp+ quota, simply run "cf-warp".
To increase your Warp+ quota by 10 GB, simply run "cf-warp 10".