chia-monitor
chia-monitor copied to clipboard
error when using command pipenv run alembic upgrade head
Hello,
When I run the command pipenv run alembic upgrade head
I get the following error:
Traceback (most recent call last):
File "/home/jorgen/.local/share/virtualenvs/chia-monitor-ou3YiYOO/bin/alembic", line 5, in
Try running pipenv install alembic
and then re-running pipenv run alembic upgrade head
.
Thanks for the reply.
By using the pipenv install alembic
the error was gone after running pipenv run alembic upgrade head
again but once I got to pipenv run python -m monitor
I got this :
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/jorgen/chia-monitor/monitor/main.py", line 138, in
Make sure that you have Prometheus installed and working correctly. I have it running as a systemctl service and I'm able to confirm that Prometheus is active and running by issuing sudo systemctl status prometheus
at the command line. Once you have confirmed that Prometheus is working properly on your system, make sure that you perform the Basic Prometheus Configuration step from the README. You can confirm this by opening a browser and going to http://localhost:9090/targets
and you should see both chia_monitor and prometheus up.
Thanks again for the reply.
Prometheus is working correctly & running. I have a dashboard with Grafana running that is showing me the stats for my system. All that works fine. I can see Chia_monitor in targets but it shows as DOWN with error : Get "http://localhost:8000/metrics": context deadline exceeded
any other suggestions? I've tried it a few times but can't get it to work
Make sure that in your /etc/prometheus/prometheus.yml
config file under the scrape_configs section that the portion that you added during setup looks something like this.
- job_name: chia_monitor
static_configs:
- targets: ['localhost:8000']
Assuming that you do have the Chia daemons running (which are necessary for this monitoring program to work) from either the Chia GUI or command line farming, you can try sudo netstat -plnt | grep :8000
to see if another program is competing for and clashing on port 8000. In a working setup, you should see a process id/python listening on tcp port 8000. If there is a port clash you should see what else is trying to use port 8000 from running this command and perhaps try a different port.
I'd like to point out again that I really appreciate all your help!
I've doubled checked and my prometheus.yml has indeed that config under scrape_configs. I also have node_exporter which is right above it in the yml file and that shows up fine. I re-add the line just to make sure So that seems to be ok. As I said before, when I go look at the prometheus page (localhost:9090) I can see chia-monitor showing up but it stays DOWN. prometheus & node_exporter also show up as UP.
Chia daemons are running. I have chia CLI farming running. (Chia is started by running chia start all, I assume that started all needed daemons?)
I've tried your command and got the following : tcp 101 0 127.0.0.1:8000 0.0.0.0:* LISTEN 3841/chia_timelord
So that also seems fine? after a fresh install I still get the following error when I try to run pipenv run python -m monitor
:
~/chia-monitor$ pipenv run python -m monitor
Traceback (most recent call last):
File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/jorgen/chia-monitor/monitor/main.py", line 138, in
Okay, so I think I fully understand your problem now. The issue is with a port conflict on tcp port 8000. The chia_timelord has a clash with the chia-monitor app on port 8000. It's not necessary to run a Chia timelord though. My guess is that the timelord started when you ran the command chia start all
. The command for your main farmer (without starting a timelord) is chia start farmer
("Service farmer will start the farmer, harvester, a full node, and the wallet." source: Chia GitHub Readme files). Run chia stop -d all
followed by chia start farmer
and then check again to see if you can get the chia-monitor to work. You may need to refresh or restart Prometheus as well. I personally use the Chia GUI on my main farmer since that machine is not starving for resources and I actually like the info that the GUI provides from a quick glance.
I just got it to work, 2 mins before I saw your reply! So the timelord could be the issue then. I shall investigate further on that. I got to a post on stack overflow after looking for the error [Python [Errno 98] Address already in use] where someone suggest to kill the command on that port to test and and I got it working after that. At first I thought it might have been the chia monitor being stuck somewhere after the first install didn't work but now that I see that the chia timelord could be the issue that would make sense. I just shut everything down (needed to do some cleaning on the computer done) so I will restart the computer soon, use command chia start farmer instead of chia start all and see if the monitor comes up again.
I'll update when I got to that but so far it looks good ! Thanks again! Im pretty new with linux/ubuntu and definitely not used to CLI only so really appreciate all the help you've given!
Update:
Works like a charm! used the start monitor command after chia started and worked right away. Thanks again for all the help !