Closed sradas closed 1 year ago
hello sradas, glad to hear this was helpful to you looks like you have problem with authentication plugin and root password template , mysql password policy wont allow you use simple password template.
Hello Hesam, thank you for fast reply and all the best in the New Year! At the end, I found that users and passwords defined in docker-compose.yml are not implemented, since script calls config.ini file. Unfortunately, inside config.ini database is named mikrotikcounter, instead of mikrotik, and so it was not created. After I changed database name, saved config.ini and rebuild all, everything works. Keep you posted after I configure basic settings. Kind regards
Docker installation is working with values defined in config.ini not in docker-compose.yml Resolved
Hello Hesam,
this Mikrotik traffic counter project has great potential. Thank you for creating such a useful piece of application. I tried to install Docker version, on Ubuntu 22.04, but it wasn't successful. Seems there is a connection issue. When starting Docker without daemon switch, I got this:
gin => generated 4398 bytes in 3 msecs (HTTP/1.1 200) 2 headers in 81 bytes (1 switches on core 0) mikrotik_traffic_counter_en-traffic-counter-1 | Traceback (most recent call last): mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 175, in _new_conn mikrotik_traffic_counter_en-traffic-counter-1 | (self._dns_host, self.port), self.timeout, extra_kw mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 95, in create_connection mikrotik_traffic_counter_en-traffic-counter-1 | raise err mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/urllib3/util/connection.py", line 85, in create_connection mikrotik_traffic_counter_en-traffic-counter-1 | sock.connect(sa) mikrotik_traffic_counter_en-traffic-counter-1 | TimeoutError: [Errno 110] Operation timed out mikrotik_traffic_counter_en-traffic-counter-1 | mikrotik_traffic_counter_en-traffic-counter-1 | During handling of the above exception, another exception occurred: mikrotik_traffic_counter_en-traffic-counter-1 | mikrotik_traffic_counter_en-traffic-counter-1 | Traceback (most recent call last): mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 710, in urlopen mikrotik_traffic_counter_en-traffic-counter-1 | chunked=chunked, mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 398, in _make_request mikrotik_traffic_counter_en-traffic-counter-1 | conn.request(method, url, httplib_request_kw) mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 239, in request mikrotik_traffic_counter_en-traffic-counter-1 | super(HTTPConnection, self).request(method, url, body=body, headers=headers) mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/http/client.py", line 1291, in request mikrotik_traffic_counter_en-traffic-counter-1 | self._send_request(method, url, body, headers, encode_chunked) mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/http/client.py", line 1337, in _send_request mikrotik_traffic_counter_en-traffic-counter-1 | self.endheaders(body, encode_chunked=encode_chunked) mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/http/client.py", line 1286, in endheaders mikrotik_traffic_counter_en-traffic-counter-1 | self._send_output(message_body, encode_chunked=encode_chunked) mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/http/client.py", line 1046, in _send_output mikrotik_traffic_counter_en-traffic-counter-1 | self.send(msg) mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/http/client.py", line 984, in send mikrotik_traffic_counter_en-traffic-counter-1 | self.connect() mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 205, in connect mikrotik_traffic_counter_en-traffic-counter-1 | conn = self._new_conn() mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/urllib3/connection.py", line 187, in _new_conn mikrotik_traffic_counter_en-traffic-counter-1 | self, "Failed to establish a new connection: %s" % e mikrotik_traffic_counter_en-traffic-counter-1 | urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f9384ee9e10>: Failed to establish a new connection: [Errno 110] Operation timed out mikrotik_traffic_counter_en-traffic-counter-1 | mikrotik_traffic_counter_en-traffic-counter-1 | During handling of the above exception, another exception occurred: mikrotik_traffic_counter_en-traffic-counter-1 | mikrotik_traffic_counter_en-traffic-counter-1 | Traceback (most recent call last): mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 450, in send mikrotik_traffic_counter_en-traffic-counter-1 | timeout=timeout mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 786, in urlopen mikrotik_traffic_counter_en-traffic-counter-1 | method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/urllib3/util/retry.py", line 592, in increment mikrotik_traffic_counter_en-traffic-counter-1 | raise MaxRetryError(_pool, url, error or ResponseError(cause)) mikrotik_traffic_counter_en-traffic-counter-1 | urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='172.16.1.1', port=8080): Max retries exceeded with url: /accounting/ip.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9384ee9e10>: Failed to establish a new connection: [Errno 110] Operation timed out',)) mikrotik_traffic_counter_en-traffic-counter-1 | mikrotik_traffic_counter_en-traffic-counter-1 | During handling of the above exception, another exception occurred: mikrotik_traffic_counter_en-traffic-counter-1 | mikrotik_traffic_counter_en-traffic-counter-1 | Traceback (most recent call last): mikrotik_traffic_counter_en-traffic-counter-1 | File "analysis.py", line 112, in
mikrotik_traffic_counter_en-traffic-counter-1 | html =fetch.url(address.mikrotik("1")) #Fetch HTML Accounting for correspondig mikrotik
mikrotik_traffic_counter_en-traffic-counter-1 | File "/etc/mikrotik_traffic_counter_en/analysis/fetch.py", line 3, in url
mikrotik_traffic_counter_en-traffic-counter-1 | r = requests.get(address)
mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 75, in get
mikrotik_traffic_counter_en-traffic-counter-1 | return request('get', url, params=params, kwargs)
mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/requests/api.py", line 61, in request
mikrotik_traffic_counter_en-traffic-counter-1 | return session.request(method=method, url=url, kwargs)
mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 529, in request
mikrotik_traffic_counter_en-traffic-counter-1 | resp = self.send(prep, send_kwargs)
mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/requests/sessions.py", line 645, in send
mikrotik_traffic_counter_en-traffic-counter-1 | r = adapter.send(request, kwargs)
mikrotik_traffic_counter_en-traffic-counter-1 | File "/usr/local/lib/python3.6/site-packages/requests/adapters.py", line 519, in send
mikrotik_traffic_counter_en-traffic-counter-1 | raise ConnectionError(e, request=request)
mikrotik_traffic_counter_en-traffic-counter-1 | requests.exceptions.ConnectionError: HTTPConnectionPool(host='172.16.1.1', port=8080): Max retries exceeded with url: /accounting/ip.cgi (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9384ee9e10>: Failed to establish a new connection: [Errno 110] Operation timed out',))
mikrotik_traffic_counter_en-traffic-counter-1 exited with code 1
mikrotik_traffic_counter_en-frontend-1 | [2022-12-27 17:13:06,829] ERROR in app: Exception on /login [POST]
mikrotik_traffic_counter_en-frontend-1 | Traceback (most recent call last):
mikrotik_traffic_counter_en-frontend-1 | File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 2073, in wsgi_app
mikrotik_traffic_counter_en-frontend-1 | response = self.full_dispatch_request()
mikrotik_traffic_counter_en-frontend-1 | File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1518, in full_dispatch_request
mikrotik_traffic_counter_en-frontend-1 | rv = self.handle_user_exception(e)
mikrotik_traffic_counter_en-frontend-1 | File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1516, in full_dispatch_request
mikrotik_traffic_counter_en-frontend-1 | rv = self.dispatch_request()
mikrotik_traffic_counter_en-frontend-1 | File "/usr/local/lib/python3.6/site-packages/flask/app.py", line 1502, in dispatch_request
mikrotik_traffic_counter_en-frontend-1 | return self.ensure_sync(self.view_functions[rule.endpoint])(*req.view_args)
mikrotik_traffic_counter_en-frontend-1 | File "./app.py", line 48, in login
mikrotik_traffic_counter_en-frontend-1 | login_check(username,password)
mikrotik_traffic_counter_en-frontend-1 | File "./tools.py", line 36, in login_check
mikrotik_traffic_counter_en-frontend-1 | autocommit=True
mikrotik_traffic_counter_en-frontend-1 | File "/usr/local/lib/python3.6/site-packages/mysql/connector/init.py", line 273, in connect
mikrotik_traffic_counter_en-frontend-1 | return MySQLConnection(args, kwargs)
mikrotik_traffic_counter_en-frontend-1 | File "/usr/local/lib/python3.6/site-packages/mysql/connector/connection.py", line 115, in init
mikrotik_traffic_counter_en-frontend-1 | self.connect(kwargs)
mikrotik_traffic_counter_en-frontend-1 | File "/usr/local/lib/python3.6/site-packages/mysql/connector/abstracts.py", line 1028, in connect
mikrotik_traffic_counter_en-frontend-1 | self._open_connection()
mikrotik_traffic_counter_en-frontend-1 | File "/usr/local/lib/python3.6/site-packages/mysql/connector/connection.py", line 496, in _open_connection
mikrotik_traffic_counter_en-frontend-1 | self._ssl, self._conn_attrs)
mikrotik_traffic_counter_en-frontend-1 | File "/usr/local/lib/python3.6/site-packages/mysql/connector/connection.py", line 234, in _do_auth
mikrotik_traffic_counter_en-frontend-1 | conn_attrs=conn_attrs)
mikrotik_traffic_counter_en-frontend-1 | File "/usr/local/lib/python3.6/site-packages/mysql/connector/protocol.py", line 109, in make_auth
mikrotik_traffic_counter_en-frontend-1 | auth_data, ssl_enabled)
mikrotik_traffic_counter_en-frontend-1 | File "/usr/local/lib/python3.6/site-packages/mysql/connector/protocol.py", line 65, in _auth_response
mikrotik_traffic_counter_en-frontend-1 | auth = get_auth_plugin(auth_plugin)(
mikrotik_traffic_counter_en-frontend-1 | File "/usr/local/lib/python3.6/site-packages/mysql/connector/authentication.py", line 1035, in get_auth_plugin
mikrotik_traffic_counter_en-frontend-1 | "Authentication plugin '{0}' is not supported".format(plugin_name))
mikrotik_traffic_counter_en-frontend-1 | mysql.connector.errors.NotSupportedError: Authentication plugin 'secret' is not supported
after some time, 3rd container dies, leaving these 2
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 870b910ece41 mikrotik_traffic_counter_en-frontend "uwsgi --socket 0.0.…" 51 minutes ago Up 50 minutes 0.0.0.0:8090->80/tcp, :::8090->80/tcp mikrotik_traffic_counter_en-frontend-1 230abd1a230c mysql:8.0 "docker-entrypoint.s…" 2 hours ago Up 51 minutes (healthy) 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp mikrotik_traffic_counter_en-database-1
On the web interface, login and password field are visible, but after entering and login, there is an Internal Server Error "The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application."
Please, if you could direct me where to look. Thank you Kind regards Sinisa