Open slvstr1 opened 10 months ago
Hi @slvstr1,
Please run mercury with docker-compose https://runmercury.com/docs/docker-compose/ - mercury should run in separate container and static files from mercury should be served with nginx.
The error that you get looks like you clone the mercury repo and started mercury server without creating static files. Please check scripts/pack_mercury.sh
- you will find there commands to build static files for mercury ...
However, running with docker-compose should be better, please let me know if you need help. We can do video chat if you want.
Dear Piotr,
Thanks for letting me know.
So docker is necessary after all, right? I installed docker and docker-compose for Centos and then I followed https://runmercury.com/docs/docker-compose/ as much as possible, using some chatgtp3 advice to overcome some small issues.
Somehow the program doesn't see the .env file and I get: @.*** mercury]$ sudo /usr/local/bin/docker-compose build WARN[0000] The "EMAIL_HOST" variable is not set. Defaulting to a blank string. WARN[0000] The "EMAIL_HOST_USER" variable is not set. Defaulting to a blank string. WARN[0000] The "EMAIL_HOST_PASSWORD" variable is not set. Defaulting to a blank string. WARN[0000] The "DEFAULT_FROM_EMAIL" variable is not set. Defaulting to a blank string. WARN[0000] The "EMAIL_PORT" variable is not set. Defaulting to a blank string.
Then the docker keeps working (It is still working after > 10 minutes).
The .env file has:
NOTEBOOKS_PATH=../ DJANGO_SUPERUSER_USERNAME=piotr DJANGO_SUPERUSER_PASSWORD=verysecretpass @. ALLOWED_HOSTS= **@.**@." DEBUG=False SERVE_STATIC=False WELCOME=/app/notebooks/welcome.md TIME_ZONE=Europe/Warsaw DJANGO_LOG_LEVEL=ERROR MERCURY_VERBOSE=0 ACCOUNT_EMAIL_VERIFICATION=none
Full workflow: In my app top folder (dEnerPred/), I run git clone https://github.com/mljar/mercury.git
I wasn't sure where to put it exactly. I put it in my app, so I get this folder structure:
dEnerPred/dEnerPredictor ... my python programs collecting and analyzing data dEnerPred/article.ipynb dEnerPred/mercury
I added the .env file in dEnerPred/mercury/ (i'ts now listed next to the file docker-compose.yml) I start docker with sudo systemctl start docker
I run: sudo /usr/local/bin/docker-compose build
I @.*** mercury]$ sudo /usr/local/bin/docker-compose build WARN[0000] The "EMAIL_HOST" variable is not set. Defaulting to a blank string. WARN[0000] The "EMAIL_HOST_USER" variable is not set. Defaulting to a blank string. WARN[0000] The "EMAIL_HOST_PASSWORD" variable is not set. Defaulting to a blank string. WARN[0000] The "DEFAULT_FROM_EMAIL" variable is not set. Defaulting to a blank string. WARN[0000] The "EMAIL_PORT" variable is not set. Defaulting to a blank string.
Thanks for your support!
Best regards,
doc. Silvester Van Koten https://orcid.org/0000-0002-1112-0126, Ph.D., +420 735 529 041 Energy Economics and Experimental Economics Senior Researcher and docent at FSE-UJEP http://www.fse.ujep.cz/en/, and Research Associate at CERGE-EI https://www.cerge-ei.cz/. Latest publ.: J. Regul. Econ. https://doi.org/10.1007/s11149-020-09421-0, Energy Econ https://doi.org/10.1016/j.eneco.2020.105059.
On Mon, Oct 2, 2023 at 4:11 PM Piotr @.***> wrote:
Hi @slvstr1 https://github.com/slvstr1,
Please run mercury with docker-compose https://runmercury.com/docs/docker-compose/ - mercury should run in separate container and static files from mercury should be served with nginx.
The error that you get looks like you clone the mercury repo and started mercury server without creating static files. Please check scripts/pack_mercury.sh - you will find there commands to build static files for mercury ...
However, running with docker-compose should be better, please let me know if you need help. We can do video chat if you want.
— Reply to this email directly, view it on GitHub https://github.com/mljar/mercury/issues/367#issuecomment-1743092166, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADES73YMG4TJEUAPG7K25HTX5LDQTAVCNFSM6AAAAAA5POQ7CGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBTGA4TEMJWGY . You are receiving this because you were mentioned.Message ID: @.***>
The docker-compose sees .env
file, but not all environment variables are defined ... you are not getting errors for NOTEBOOKS_PATH
. Mercury should work without email variables configuration.
Are you able to access 0.0.0.0
address after starting docker?
It looks like it is still building: > 3902s now. [image: image.png] And I do not see anything on my IP from outside, these both show "bad gateway":
http://78.128.250.126 http://78.128.250.126/admin
On the server itself, something seems to be going on, though, once I try ping, I get: (venv) @.*** dEnerPred]$ ping 0.0.0.0 PING 0.0.0.0 (127.0.0.1) 56(84) bytes of data. 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.045 ms 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.046 ms 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.046 ms 64 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.060 ms 64 bytes from 127.0.0.1: icmp_seq=5 ttl=64 time=0.041 ms 64 bytes from 127.0.0.1: icmp_seq=6 ttl=64 time=0.058 ms
On Tue, Oct 3, 2023 at 2:33 PM Piotr @.***> wrote:
The docker-compose sees .env file, but not all environment variables are defined ... you are not getting errors for NOTEBOOKS_PATH. Mercury should work without email variables configuration.
Are you able to access 0.0.0.0 address after starting docker?
— Reply to this email directly, view it on GitHub https://github.com/mljar/mercury/issues/367#issuecomment-1744874153, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADES735PPNQCGKJFO5LWN3TX5QAZBAVCNFSM6AAAAAA5POQ7CGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBUHA3TIMJVGM . You are receiving this because you were mentioned.Message ID: @.***>
First build might be long, but it should be few minutes, ~5-10 minutes on small RAM machine (do you have more than 2GB RAM machine?). Do you have some logs from building? Could you please send them?
You need to start docker first to have IP addresses working ...
I don't see any containers in the docker/containers folder, and thus also no logs.
(venv) @.*** dEnerPred]$ sudo ls -a /var/lib/docker/
. .. buildkit containers engine-id image network overlay2 plugins runtimes swarm tmp volumes (venv) @.*** dEnerPred]$ sudo ls -a /var/lib/docker/containers . ..
As I understand it, this server has 12GB available in RAM: (venv) @. dEnerPred]$ free -h total used free shared buff/cache available Mem: 15Gi 1,3Gi 1,9Gi 898Mi 12Gi 12Gi Swap: 0B 0B 0B (venv) @. dEnerPred]$
On Tue, Oct 3, 2023 at 3:28 PM Piotr @.***> wrote:
First build might be long, but it should be few minutes, ~5-10 minutes on small RAM machine (do you have more than 2GB RAM machine?). Do you have some logs from building? Could you please send them?
You need to start docker first to have IP addresses working ...
— Reply to this email directly, view it on GitHub https://github.com/mljar/mercury/issues/367#issuecomment-1744980519, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADES733P4TA426BRCUKQSLDX5QHIBAVCNFSM6AAAAAA5POQ7CGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBUHE4DANJRHE . You are receiving this because you were mentioned.Message ID: @.***>
Actually, he is now not hanging anymore, so it looks more promising now.
On Tue, Oct 3, 2023 at 4:10 PM Silvester Van Koten @.***> wrote:
I don't see any containers in the docker/containers folder, and thus also no logs.
(venv) @.*** dEnerPred]$ sudo ls -a /var/lib/docker/
. .. buildkit containers engine-id image network overlay2 plugins runtimes swarm tmp volumes (venv) @.*** dEnerPred]$ sudo ls -a /var/lib/docker/containers . ..
As I understand it, this server has 12GB available in RAM: (venv) @. dEnerPred]$ free -h total used free shared buff/cache available Mem: 15Gi 1,3Gi 1,9Gi 898Mi 12Gi 12Gi Swap: 0B 0B 0B (venv) @. dEnerPred]$
On Tue, Oct 3, 2023 at 3:28 PM Piotr @.***> wrote:
First build might be long, but it should be few minutes, ~5-10 minutes on small RAM machine (do you have more than 2GB RAM machine?). Do you have some logs from building? Could you please send them?
You need to start docker first to have IP addresses working ...
— Reply to this email directly, view it on GitHub https://github.com/mljar/mercury/issues/367#issuecomment-1744980519, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADES733P4TA426BRCUKQSLDX5QHIBAVCNFSM6AAAAAA5POQ7CGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBUHE4DANJRHE . You are receiving this because you were mentioned.Message ID: @.***>
The 12GB RAM is a true beast for Mercury. It will work smoothly.
I'm using commands:
sudo docker ps
and to start docker-compose
sudo docker-compose up
I now also use
sudo docker ps
and to start docker-compose:
sudo docker-compose up
The program then hangs. I have attached the whole log. The logs end in this;
Retrying...
Retrying...
Retrying...
this module.
compatibility check. Excluding it from installation.
this module.
compatibility check. Excluding it from installation.
dependency @.***/dom@>=7.21.4".
peer dependency "react@^18.2.0".
"react@^0.14.9 || ^15.3.0 || ^16.0.0".
"react-dom@^0.14.9 || ^15.3.0 || ^16.0.0".
dependency "react@>= 18.0.0".
dependency "react-dom@>= 18.0.0".
On Tue, Oct 3, 2023 at 4:25 PM Piotr @.***> wrote:
The 12GB RAM is a true beast for Mercury. It will work smoothly.
I'm using commands:
sudo docker ps
and to start docker-compose
sudo docker-compose up
— Reply to this email directly, view it on GitHub https://github.com/mljar/mercury/issues/367#issuecomment-1745088847, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADES73Z65ZCIIF6YQQ2UBPTX5QN55AVCNFSM6AAAAAA5POQ7CGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBVGA4DQOBUG4 . You are receiving this because you were mentioned.Message ID: @.***>
Hi @slvstr1, I have no idea why it hangs ...
Have you tried to run:
sudo docker-compose up --build
maybe it will start after build, somehow?
Are you able to reproduce the issue locally on your local machine/laptop?
Thanks for the help!
It now works: http://78.128.250.126/app/article
Apparently, it had been built even though it hangs.
There were still connection problems, so I looked up the Dockerfiles that are used and added the line ENV ALPINE_MIRROR http://dl-cdn.alpinelinux.org/alpine
Then it worked running: sudo /usr/local/bin/docker-compose --verbose up
Thanks a lot for your help. Sorry for the newby questions - I never used docker before.
best regards,
Silvester
doc. Silvester Van Koten https://orcid.org/0000-0002-1112-0126, Ph.D., +420 735 529 041 Energy Economics and Experimental Economics Senior Researcher and docent at FSE-UJEP http://www.fse.ujep.cz/en/, and Research Associate at CERGE-EI https://www.cerge-ei.cz/. Latest publ.: J. Regul. Econ. https://doi.org/10.1007/s11149-020-09421-0, Energy Econ https://doi.org/10.1016/j.eneco.2020.105059.
On Thu, Oct 5, 2023 at 11:44 AM Piotr @.***> wrote:
Hi @slvstr1 https://github.com/slvstr1, I have no idea why it hangs ...
Have you tried to run:
sudo docker-compose up --build
maybe it will start after build, somehow?
Are you able to reproduce the issue locally on your local machine/laptop?
— Reply to this email directly, view it on GitHub https://github.com/mljar/mercury/issues/367#issuecomment-1748503369, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADES73Y3S5TEH436VOQ5KDLX5Z6RTAVCNFSM6AAAAAA5POQ7CGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBYGUYDGMZWHE . You are receiving this because you were mentioned.Message ID: @.***>
I run django on a server. On the server, I activate the virtual environment. Mercury is there installed. I am using nginx with this code for mercury:
I run
mercury run 8002
I get
Indeed, opening http://78.128.250.126/, I get the error "Template does not exist"![image](https://github.com/mljar/mercury/assets/13185007/5a328cd9-3292-43c2-8ce0-3834eb434e33)
Opening http://78.128.250.126/admin seems to work: it shows an admin login dialog as it should (I didn't try log in).
Should I change my Nginx settings, install, or start Mercury differently?
I have earlier added a report to issue 356 (https://github.com/mljar/mercury/issues/356). I updated mercury and I now see a different error than the earlier one.
Full output: