shadowsocks / shadowsocks-manager

A shadowsocks manager tool for multi user and traffic control.
https://shadowsocks.github.io/shadowsocks-manager/
GNU General Public License v3.0
4.12k stars 1.53k forks source link

[Error] flowSaver connect to server password@XX.XX.XX.XX:6002 fail #138

Closed lRoccoon closed 7 years ago

lRoccoon commented 7 years ago

我已经在单台机器上安装完成,使用也没有问题,但是,在扩展到多台机器时,webgui与另一台机器的manager链接不上,错误为:

[Error] flowSaver connect to server password@XX.XX.XX.XX:6002 fail.

我尝试关闭防火墙,依然不行,我自己用Python写了一个小的Demo,测试发现6002端口没有被屏蔽,可以正常通讯。

看错误提示,我发现时flowSaver模块的问题,我尝试关闭这个模块,然后会得到一下错误信息:

[ERROR] system - Unhandled Rejection at: Promise Promise {
  <rejected> { Error: select "id", "name", "host", "port", "password", "method" from "server" order by "name" asc - SQLITE_ERROR: no such table: server
    at Error (native) errno: 1, code: 'SQLITE_ERROR' } } reason: { Error: select "id", "name", "host", "port", "password", "method" from "server" order by "name" asc - SQLITE_ERROR: no such table: server
    at Error (native) errno: 1, code: 'SQLITE_ERROR' }

运行环境:

OS: CentOS7 x86_64 npm: 3.10.10 nodejs: v6.9.4 ssmgr: shadowsocks-manager 0.5.37 shadowsocks-libev: 3.0.4

具体配置信息如下:

#webgui.yml

type: m
empty: false

manager:
  address: XX.XX.XX.XX:6002  # IP 地址没有问题
  password: '123456'
plugins:
  flowSaver:
    use: true
  user:
    use: true
  account:
    use: true
    pay:
      hour:
        price: 0.03
        flow: 500000000
      day:
        price: 0.5
        flow: 7000000000
      week:
        price: 3
        flow: 50000000000
      month:
        price: 10
        flow: 200000000000
      season:
        price: 30
        flow: 200000000000
      year:
        price: 120
        flow: 200000000000
  email:
    use: true
    username: 'XXXX@email.com'
    password: 'password'
    host: 'smtp.email.com'
  webgui:
    use: true
    host: '0.0.0.0'
    port: '80'
    site: 'http://yourwebsite.com'
    gcmSenderId: '456102641793'
    gcmAPIKey: 'AAAAGzzdqrE:XXXXXXXXXXXXXX'
  alipay:
    use: true
    appid: 2015012108272442
    notifyUrl: ''
    merchantPrivateKey: 'xxxxxxxxxxxx'
    alipayPublicKey: 'xxxxxxxxxxx'
    gatewayUrl: 'https://openapi.alipay.com/gateway.do'
db: 'webgui.sqlite'
#default.yml
type: s
empty: false

shadowsocks:
  address: 127.0.0.1:4000
  #portRange: 50000-51000,55000,55002

manager:
  address: 0.0.0.0:6002
  password: '123456'

db: 'db.sqlite'
gyteng commented 7 years ago

是在网页里边添加的第二台机吗

lRoccoon commented 7 years ago

是的

lRoccoon commented 7 years ago

或者说,第一台机器是另一台的时候,也报错

gyteng commented 7 years ago

会不会是密码不一致

lRoccoon commented 7 years ago

都是123456

gyteng commented 7 years ago

不清楚,看起来你的步骤没有问题

lRoccoon commented 7 years ago

如果通过网页添加的话,会出现一下错误:

[ERROR] system - Unhandled Rejection at: Promise Promise {
  <rejected> { Error: select * from "alipay" where "expireTime" not between 0 and 1489906068902 - SQLITE_ERROR: no such table: alipay
    at Error (native) errno: 1, code: 'SQLITE_ERROR' } } reason: { Error: select * from "alipay" where "expireTime" not between 0 and 1489906068902 - SQLITE_ERROR: no such table: alipay
    at Error (native) errno: 1, code: 'SQLITE_ERROR' }
Error: ssmgr[s] connection close
    at Socket.client.on (/usr/lib/node_modules/shadowsocks-manager/lib/services/manager.js:98:14)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at TCP._handle.close [as _onclose] (net.js:498:12)
[ERROR] express - [undefined] POST 403 1201ms /api/admin/server

另一侧的的控制台不显示任何信息。我用抓包工具抓了一下,发现时webgui给manager发送了以下内容:

{"command":"flow", "options:{"clear":false}}
gyteng commented 7 years ago

建议删除SQLite文件重新运行

2017年3月19日 14:49,"873314461" notifications@github.com写道:

如果通过网页添加的话,会出现一下错误:

[ERROR] system - Unhandled Rejection at: Promise Promise {

{ Error: select * from "alipay" where "expireTime" not between 0 and 1489906068902 - SQLITE_ERROR: no such table: alipay at Error (native) errno: 1, code: 'SQLITE_ERROR' } } reason: { Error: select * from "alipay" where "expireTime" not between 0 and 1489906068902 - SQLITE_ERROR: no such table: alipay at Error (native) errno: 1, code: 'SQLITE_ERROR' } Error: ssmgr[s] connection close at Socket.client.on (/usr/lib/node_modules/shadowsocks-manager/lib/services/manager.js:98:14) at emitOne (events.js:96:13) at Socket.emit (events.js:188:7) at TCP._handle.close [as _onclose] (net.js:498:12) [ERROR] express - [undefined] POST 403 1201ms /api/admin/server — You are receiving this because you commented. Reply to this email directly, view it on GitHub , or mute the thread .
lRoccoon commented 7 years ago

数据库全部删除后,得到这个错误:

Error: ssmgr[s] connection close
    at Socket.client.on (/usr/lib/node_modules/shadowsocks-manager/lib/services/manager.js:98:14)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at TCP._handle.close [as _onclose] (net.js:498:12)
[2017-03-19 14:55:07.721] [ERROR] express - [undefined] POST 403 414ms /api/admin/server

这个也是通过网页添加的。

gyteng commented 7 years ago

删除后需要重新运行,其次不能单独关闭某个模块

lRoccoon commented 7 years ago

问题解决了,安装最新的node,运行最新的shadowsocks-manager就没有问题了。

KevinNSA commented 6 years ago

更新一个解决方案 删除.ssmgr目录下的default.yml