mimamch / wa-gateway

Headless Multi Session Whatsapp Gateway API
MIT License
207 stars 108 forks source link

bermasalah di VPS #22

Closed 94maldini closed 1 year ago

94maldini commented 1 year ago

saya menjalankan wa-gateway ini di vps tapi ada masalah, setelah GET /start-session?session=558822&scan=true muncul log seperti ini

connecting =>  558822
connecting =>  558822
connecting =>  558822
connecting =>  558822
connecting =>  558822
connecting =>  558822
connecting =>  558822
connecting =>  558822
connecting =>  558822
connecting =>  558822
connecting =>  558822
disconnected =>  558822

langsung menghubungkan session 558822 tampa scan qr dengan keadaan folder wa_credentials kosong tidak ada session samasekali, dan saya test GET /send-message?to=081xxxxxxx&text=maldini%20test%20api%202&session=558822 muncul error seperti ini

TypeError: Right-hand side of 'instanceof' is not an object
    at errorHandlerMiddleware (/root/nodejs/apiWa/app/middlewares/error_middleware.js:9:13)
    at Layer.handle_error (/root/nodejs/apiWa/node_modules/express/lib/router/layer.js:71:5)
    at trim_prefix (/root/nodejs/apiWa/node_modules/express/lib/router/index.js:326:13)
    at /root/nodejs/apiWa/node_modules/express/lib/router/index.js:286:9
    at Function.process_params (/root/nodejs/apiWa/node_modules/express/lib/router/index.js:346:12)
    at Immediate.next (/root/nodejs/apiWa/node_modules/express/lib/router/index.js:280:10)
    at Immediate.<anonymous> (/root/nodejs/apiWa/node_modules/express/lib/router/index.js:646:15)
    at process.processImmediate (node:internal/timers:478:21)

saya menjalankan VPS ubuntu-22.04-x86_64, nodejs versi v18.17.1 tapi saya jalankan di localhost windows jadi berjalan dengan normal

mimamch commented 1 year ago

sepertinya ada duplikat dengan session ID yang sudah ada: 558822, apakah sudah dicoba dengan session ID yang berbeda?

94maldini commented 1 year ago

sepertinya ada duplikat dengan session ID yang sudah ada: 558822, apakah sudah dicoba dengan session ID yang berbeda?

biar id baru tetap sama sudah bikin id baru 4x tetap sama

mimamch commented 1 year ago

dari error "TypeError: Right-hand side of 'instanceof' is not an object" itu sepertinya depedency wa-multi-session bukan versi terbaru, bisa coba dimulai dengan npm install dahulu

94maldini commented 1 year ago

sudah npm install wa-multi-session@latest tapi tetap kembali ke 2.1.0

# npm audit report

protobufjs  6.10.0 - 7.2.3
Severity: high
protobufjs Prototype Pollution vulnerability - https://github.com/advisories/GHSA-h755-8qp9-cq85
fix available via `npm audit fix --force`
Will install wa-multi-session@3.2.1, which is a breaking change
node_modules/protobufjs
  @adiwajshing/baileys  >=3.0.0
  Depends on vulnerable versions of protobufjs
  node_modules/@adiwajshing/baileys
    wa-multi-session  <=2.1.0
    Depends on vulnerable versions of @adiwajshing/baileys
    node_modules/wa-multi-session

3 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

dan sudah lakukan npm audit fix --force tetap ke 2.1.0 bukan ke 3.2.0, sudah lakukan hapus package-lock.json dan update dependencies "wa-multi-session": "3.2.0" tetap kembali 2.1.0

mimamch commented 1 year ago

Bisa dicoba untuk clone ulang repositorynya

94maldini commented 1 year ago

masih

APP IS RUNNING ON PORT 5001
connecting =>  cloudwa
GET /start-session?session=cloudwa&scan=true - - ms - -
connecting =>  aefdewaewf
connecting =>  cloudwa
connecting =>  aefdewaewf
connecting =>  cloudwa
connecting =>  aefdewaewf
connecting =>  aefdewaewf
connecting =>  cloudwa
connecting =>  aefdewaewf
connecting =>  cloudwa
connecting =>  aefdewaewf
connecting =>  cloudwa
connecting =>  aefdewaewf
connecting =>  cloudwa
connecting =>  cloudwa
connecting =>  aefdewaewf
connecting =>  cloudwa
connecting =>  aefdewaewf
connecting =>  cloudwa
connecting =>  aefdewaewf
connecting =>  aefdewaewf
connecting =>  cloudwa
disconnected =>  aefdewaewf
disconnected =>  cloudwa

server saya bermasalah atau apa sampai bisa begini

Cloud-Dark commented 1 year ago
  1. coba gunakan repo terbaru
  2. coba gunakan nodejs versi 16
  3. coba atur dir seperti ini image
94maldini commented 1 year ago
  1. coba gunakan repo terbaru
  2. coba gunakan nodejs versi 16
  3. coba atur dir seperti ini image

Ok sudah berhasil. Trimakasih