M0r13n / mikrotik_monitoring

Monitor your Mikrotik router with Prometheus and Grafana
MIT License
240 stars 33 forks source link

installation issue #30

Closed crowfeatherjoe closed 2 months ago

crowfeatherjoe commented 2 months ago

Upon trying to follow the initial installation procedure, I get stuck at the following step:

``docker-compose up -d Traceback (most recent call last): File "/usr/lib/python3/dist-packages/docker/api/client.py", line 214, in _retrieve_server_version return self.version(api_version=False)["ApiVersion"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/docker/api/daemon.py", line 181, in version return self._result(self._get(url), json=True) ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 46, in inner return f(self, *args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/docker/api/client.py", line 237, in _get return self.get(url, self._set_request_timeout(kwargs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/sessions.py", line 602, in get return self.request("GET", url, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/sessions.py", line 589, in request resp = self.send(prep, send_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( ^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 791, in urlopen response = self._make_request( ^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 497, in _make_request conn.request( TypeError: HTTPConnection.request() got an unexpected keyword argument 'chunked'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/bin/docker-compose", line 33, in sys.exit(load_entry_point('docker-compose==1.29.2', 'console_scripts', 'docker-compose')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 81, in main command_func() File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 200, in perform_command project = project_from_options('.', options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 60, in project_from_options return get_project( ^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 152, in get_project client = get_client( ^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 41, in get_client client = docker_client( ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/compose/cli/docker_client.py", line 170, in docker_client client = APIClient(use_ssh_client=not use_paramiko_ssh, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/docker/api/client.py", line 197, in init self._version = self._retrieve_server_version() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/docker/api/client.py", line 221, in _retrieve_server_version raise DockerException( docker.errors.DockerException: Error while fetching server API version: HTTPConnection.request() got an unexpected keyword argument 'chunked'``

crowfeatherjoe commented 2 months ago

using the latest fresh install of Ubuntu 24.04 LTS. nothing else on the VM.

M0r13n commented 2 months ago

@crowfeatherjoe This seems to be unrelated to this project itself. You are using docker-compose, which is deprecated. Instead, you should use docker compose on newer platforms. Make sure to follow the steps listed in the official installation guide.

crowfeatherjoe commented 2 months ago

the instructions specifically call for docker-compose. can you walk me through how to fix this or update the documentation? Emailed you. Or at least what version of ubuntu server can I run this on that is compatible?

baylanger commented 2 months ago

I could be wrong ... while the instructions still refers to docker-compose , on newer platforms you must use docker compose. 1) not everyone uses "latest greatest platforms" 2) yes there's place for improvements with the docs to support newer platforms - until then you should either follow the instruction pointed out by @M0r13n or something much easier, just don't use the latest greatest Ubuntu.

crowfeatherjoe commented 2 months ago

I could be wrong ... while the instructions still refers to docker-compose , on newer platforms you must use docker compose. 1) not everyone uses "latest greatest platforms" 2) yes there's place for improvements with the docs to support newer platforms - until then you should either follow the instruction pointed out by @M0r13n or something much easier, just don't use the latest greatest Ubuntu.

If I knew which version of Ubuntu was supported it would be greatly appreciated. I'm pretty new to Linux so I'm doing my best to parse things together. @M0r13n let me know what I can do to simplify this process please. Really would like to play with this project.

baylanger commented 2 months ago

I started on Linux back in Dec 1992 ... welcome to Linux - sure is a great OS :)

I'm not expert enough with Docker but ... my guess is that you installed docker from a package available for Ubuntu 24 (Noble). I doubt Docker provides old packages aka pre docker compose for the latest Ubuntu releases.

You could try Ubuntu 18 and follow these instructions - once you have docker installed, if docker-compose gives you a command not found you might need to do a pip install docker-compose but to be honest, I'm not positive.

Reddit could be a good place to get help.

M0r13n commented 2 months ago

Hey @baylanger @crowfeatherjoe,

docker-compose was originally written in Python, but it was deprecated some time ago. Instead, a new version written in Go supersedes the previous Python version. I will update the README soon.

To fix your issue, follow these steps:

  1. Remove docker-compose (either apt remove docker-compose or pip uninstall docker-compose).
  2. Install Docker.
  3. Use docker compose instead of docker-compose.

So docker-compose up -d becomes docker compose up -d.

crowfeatherjoe commented 2 months ago

Screenshot 2024-06-21 001225 We did it! Thank you Leon!

For my particular installation, I have some notes:

  1. installing docker on ubuntu-24.04-live-server-amd64 in virtualbox apparently counts as a derivative distro, so the note in step 1 of their documentation should be changed to exactly: $(. /etc/os-release && echo "$UBUNTU_CODENAME") before executing.
  2. mktxp.conf needs to be edited to point towards the Mikrotik device before doing docker compose up -d
M0r13n commented 2 months ago

Hey @crowfeatherjoe,

I am glad to see that it works for you! :)

Installing Docker on ubuntu-24.04-live-server-amd64 in VirtualBox apparently counts as a derivative distro, so the note in step 1 of their documentation should be changed to exactly: $(. /etc/os-release && echo "$UBUNTU_CODENAME") before executing.

You are referring to the installation of Docker, correct? That documentation is not under my control.

mktxp.conf needs to be edited to point towards the Mikrotik device before doing docker compose up -d

That is literally the next sentence:

You may need to adjust the following configuration files and add your own credentials for your router: mktxp/mktxp.conf

I think this is fine.

Anyway, I hope you find the project useful. Feel free to report any problem or bug that may arise while using it.