Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection errors in nodes #763

Closed
ImMohammad20000 opened this issue Jan 26, 2024 · 4 comments
Closed

Connection errors in nodes #763

ImMohammad20000 opened this issue Jan 26, 2024 · 4 comments

Comments

@ImMohammad20000
Copy link
Collaborator

ImMohammad20000 commented Jan 26, 2024

how to fix node connecting issues?

Any other ideas?

@ImMohammad20000
Copy link
Collaborator Author

ImMohammad20000 commented Jan 26, 2024

when node is down som times this logs show in marzban logs

marzban-marzban-1     | Job "record_node_usages (trigger: interval[0:00:10], next run at: 2024-01-26 16:37:29 UTC)" raised an exception
marzban-marzban-1     | Traceback (most recent call last):
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/apscheduler/executors/base.py", line 125, in run_job
marzban-marzban-1     |     retval = job.func(*job.args, **job.kwargs)
marzban-marzban-1     |   File "/code/app/jobs/record_usages.py", line 168, in record_node_usages
marzban-marzban-1     |     api_instances[node_id] = node.api
marzban-marzban-1     |   File "/code/app/xray/node.py", line 125, in api
marzban-marzban-1     |     raise ConnectionError("Node is not connected")
marzban-marzban-1     | ConnectionError: Node is not connected

and


marzban-marzban-1     |     httplib_response = self._make_request(
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 449, in _make_request
marzban-marzban-1     |     six.raise_from(e, None)
marzban-marzban-1     |   File "<string>", line 3, in raise_from
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 444, in _make_request
marzban-marzban-1     |     httplib_response = conn.getresponse()
marzban-marzban-1     |   File "/usr/local/lib/python3.10/http/client.py", line 1375, in getresponse
marzban-marzban-1     |     response.begin()
marzban-marzban-1     |   File "/usr/local/lib/python3.10/http/client.py", line 318, in begin
marzban-marzban-1     |     version, status, reason = self._read_status()
marzban-marzban-1     |   File "/usr/local/lib/python3.10/http/client.py", line 287, in _read_status
marzban-marzban-1     |     raise RemoteDisconnected("Remote end closed connection without"
marzban-marzban-1     | http.client.RemoteDisconnected: Remote end closed connection without response
marzban-marzban-1     |
marzban-marzban-1     | During handling of the above exception, another exception occurred:
marzban-marzban-1     |
marzban-marzban-1     | Traceback (most recent call last):
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 489, in send
marzban-marzban-1     |     resp = conn.urlopen(
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 787, in urlopen
marzban-marzban-1     |     retries = retries.increment(
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/urllib3/util/retry.py", line 550, in increment
marzban-marzban-1     |     raise six.reraise(type(error), error, _stacktrace)
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/urllib3/packages/six.py", line 769, in reraise
marzban-marzban-1     |     raise value.with_traceback(tb)
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
marzban-marzban-1     |     httplib_response = self._make_request(
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 449, in _make_request
marzban-marzban-1     |     six.raise_from(e, None)
marzban-marzban-1     |   File "<string>", line 3, in raise_from
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/urllib3/connectionpool.py", line 444, in _make_request
marzban-marzban-1     |     httplib_response = conn.getresponse()
marzban-marzban-1     |   File "/usr/local/lib/python3.10/http/client.py", line 1375, in getresponse
marzban-marzban-1     |     response.begin()
marzban-marzban-1     |   File "/usr/local/lib/python3.10/http/client.py", line 318, in begin
marzban-marzban-1     |     version, status, reason = self._read_status()
marzban-marzban-1     |   File "/usr/local/lib/python3.10/http/client.py", line 287, in _read_status
marzban-marzban-1     |     raise RemoteDisconnected("Remote end closed connection without"
marzban-marzban-1     | urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
marzban-marzban-1     |
marzban-marzban-1     | During handling of the above exception, another exception occurred:
marzban-marzban-1     |
marzban-marzban-1     | Traceback (most recent call last):
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/telebot/__init__.py", line 955, in infinity_polling
marzban-marzban-1     |     self.polling(non_stop=True, timeout=timeout, long_polling_timeout=long_polling_timeout,
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/telebot/__init__.py", line 1043, in polling
marzban-marzban-1     |     self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout,
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/telebot/__init__.py", line 1118, in __threaded_polling
marzban-marzban-1     |     raise e
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/telebot/__init__.py", line 1073, in __threaded_polling
marzban-marzban-1     |     polling_thread.raise_exceptions()
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/telebot/util.py", line 118, in raise_exceptions
marzban-marzban-1     |     raise self.exception_info
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/telebot/util.py", line 100, in run
marzban-marzban-1     |     task(*args, **kwargs)
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/telebot/__init__.py", line 649, in __retrieve_updates
marzban-marzban-1     |     updates = self.get_updates(offset=(self.last_update_id + 1),
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/telebot/__init__.py", line 623, in get_updates
marzban-marzban-1     |     json_updates = apihelper.get_updates(self.token, offset, limit, timeout, allowed_updates, long_polling_timeout)
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/telebot/apihelper.py", line 321, in get_updates
marzban-marzban-1     |     return _make_request(token, method_url, params=payload)
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/telebot/apihelper.py", line 156, in _make_request
marzban-marzban-1     |     result = _get_req_session().request(
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 587, in request
marzban-marzban-1     |     resp = self.send(prep, **send_kwargs)
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 701, in send
marzban-marzban-1     |     r = adapter.send(request, **kwargs)
marzban-marzban-1     |   File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 547, in send
marzban-marzban-1     |     raise ConnectionError(err, request=request)
marzban-marzban-1     | requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

@parhawm
Copy link
Contributor

parhawm commented Jan 27, 2024

من فکر نمیکنم rpyc از اول ایده خوبی بوده
ولی این رو احتمالا بشه با تغییر تنظیمات tcp keepalive حل کرد. شایدم موارد دیگه رو بدون بررسی تغییر دادید که اینطور شده

@ImMohammad20000
Copy link
Collaborator Author

من فکر نمیکنم rpyc از اول ایده خوبی بوده

اگه فکر بهتری داری بگو پیاده کنیم

من یه باگ تو لاگ ها پیدا کردم که باعث قطعی بود فیکسش کردم ولی هنوز ارور تایم اوت و بقیه ارور ها هست که وضعیتو خیلی آن استیبل کرده😑😑😑

@m0x61h0x64i
Copy link

Gozargah/Marzban-node#46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants