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

Docker install does not work on Ubuntu 20.04 #263

Closed
Jayd603 opened this issue Feb 6, 2022 · 13 comments
Closed

Docker install does not work on Ubuntu 20.04 #263

Jayd603 opened this issue Feb 6, 2022 · 13 comments
Labels
bug Something isn't working

Comments

@Jayd603
Copy link

Jayd603 commented Feb 6, 2022

I tried multiple install settings, several rebuilds. It all starts fine, trying to connect via HTTPS gives a 500 Internal server error. .. one time I got an API error instead. Nothing I tried worked. Any magic I'm missing?

@Jayd603 Jayd603 added the bug Something isn't working label Feb 6, 2022
@MrNaif2018
Copy link
Member

Hi! Could you post full list of settings you have used? That's basically:

cat .env # execute in bitcart-docker dir
cat /etc/profile.d/bitcartcc-env.sh

Please redact any sensitive settings if needed. That error may often occur when https is not enabled, i.e. BITCART_REVERSEPROXY != nginx-https
Another case is that https certificate was failed to acquire
Some logs may be useful, please send

docker logs compose_backend_1
docker logs compose_admin_1
docker logs letsencrypt-nginx-proxy-companion

@Jayd603
Copy link
Author

Jayd603 commented Feb 6, 2022

Ok now we're narrowing it down... LetsEncrypt issues. What should i be setting in env for it?


root@crypto1:/home/jd/bitcart-docker# docker logs letsencrypt-nginx-proxy-companion
Info: running acme-companion version v2.1.3
Warning: '/etc/acme.sh' does not appear to be a mounted volume.
Info: 4096 bits RFC7919 Diffie-Hellman group found, generation skipped.
Reloading nginx docker-gen (using separate container nginx-gen)...
Reloading nginx (using separate container nginx)...
Warning: /app/letsencrypt_service_data not found, skipping data from containers.
Sleep for 3600s
2022/02/06 18:01:40 Generated '/app/letsencrypt_service_data' from 12 containers
2022/02/06 18:01:40 Running '/app/signal_le_service'
2022/02/06 18:01:40 Watching docker events
2022/02/06 18:01:40 Contents of /app/letsencrypt_service_data did not change. Skipping notification '/app/signal_le_service'
[Sun Feb 6 18:01:41 UTC 2022] Create account key ok.
[Sun Feb 6 18:01:41 UTC 2022] Registering account: https://acme-v02.api.letsencrypt.org/directory
dgst: Can only sign or verify one file.
[Sun Feb 6 18:01:42 UTC 2022] Registered
[Sun Feb 6 18:01:42 UTC 2022] Can not find account id url.
[Sun Feb 6 18:01:42 UTC 2022]
[Sun Feb 6 18:01:42 UTC 2022] The account url is empty, please run '--update-account' first to update the account info first,
[Sun Feb 6 18:01:42 UTC 2022] Then try again.
Reloading nginx docker-gen (using separate container nginx-gen)...
Reloading nginx (using separate container nginx)...
Creating/renewal crypto1.MYNETWORK.net certificates... (crypto1.MYNETWORK.net)
[Sun Feb 6 18:01:43 UTC 2022] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Sun Feb 6 18:01:43 UTC 2022] Registering account: https://acme-v02.api.letsencrypt.org/directory
dgst: Can only sign or verify one file.
[Sun Feb 6 18:01:43 UTC 2022] Registered
[Sun Feb 6 18:01:43 UTC 2022] Can not find account id url.
[Sun Feb 6 18:01:43 UTC 2022]
[Sun Feb 6 18:01:43 UTC 2022] Please check log file for more details: /dev/null
[Sun Feb 6 18:01:43 UTC 2022] The account url is empty, please run '--update-account' first to update the account info first,
[Sun Feb 6 18:01:43 UTC 2022] Then try again.
Creating/renewal crypto1.MYNETWORK.net certificates... (crypto1.MYNETWORK.net)
[Sun Feb 6 18:01:44 UTC 2022] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Sun Feb 6 18:01:44 UTC 2022] Registering account: https://acme-v02.api.letsencrypt.org/directory
dgst: Can only sign or verify one file.
[Sun Feb 6 18:01:45 UTC 2022] Registered
[Sun Feb 6 18:01:45 UTC 2022] Can not find account id url.
[Sun Feb 6 18:01:45 UTC 2022]
[Sun Feb 6 18:01:45 UTC 2022] Please check log file for more details: /dev/null
[Sun Feb 6 18:01:45 UTC 2022] The account url is empty, please run '--update-account' first to update the account info first,
[Sun Feb 6 18:01:45 UTC 2022] Then try again.

@Jayd603
Copy link
Author

Jayd603 commented Feb 6, 2022

Ok, resolved that with setting: BITCART_LETSENCRYPT_EMAIL

Now it's hanging on something else, let me see what I find.

@MrNaif2018
Copy link
Member

Weird, did you have it set? It shouldn't be required anyway
Your full list of settings would still help me to find out the cause faster (:
But yeah it is probably SSL fetching issue

@MrNaif2018
Copy link
Member

Ohh, I can reproduce on a new deployment. It is a regression due to unpinned image upgrading to 2.0.0:
nginx-proxy/acme-companion#510
I will try to fix it soon

@Jayd603
Copy link
Author

Jayd603 commented Feb 6, 2022

It is also grabbing a new cert every restart it seems like.

[Sun Feb 6 19:47:49 UTC 2022] Create new order error. Le_OrderFinalize not found. {
"type": "urn:ietf:params:acme:error:rateLimited",
"detail": "Error creating new order :: too many certificates (5) already issued for this exact set of domains in the last 168 hours: crypto1.MYNETWORK.net: see https://letsencrypt.org/docs/rate-limits/",
"status": 429
}

@MrNaif2018
Copy link
Member

A workaround for now would be:

./stop.sh
docker image rm jrcs/letsencrypt-nginx-proxy-companion
docker pull jrcs/letsencrypt-nginx-proxy-companion:v1.13.1
./start.sh

Looks like so, it doesn't mount the new volume dir.
As for too many certs issue you have to wait

@MrNaif2018
Copy link
Member

Fixed by bitcart/bitcart-docker@7f9e90e

You can now do unset BITCART_LETSENCRYPT_EMAIL and re-run setup (before that, of course update via ./update.sh)

As per the rate limits, probably waiting a bit should help

Let me know when the issue is fixed so that we can close the issue

@Jayd603
Copy link
Author

Jayd603 commented Feb 7, 2022

Still having issues - ssl seems to work correctly but now things just hang when i try to visit the HOST. After 60 seconds a page pops up saying admin is unconfigured with an error.

{ "message": "Client network socket disconnected before secure TLS connection was established", "name": "Error", "stack": "Error: Client network socket disconnected before secure TLS connection was established\n at connResetException (internal/errors.js:639:14)\n at TLSSocket.onConnectEnd (_tls_wrap.js:1570:19)\n at TLSSocket.emit (events.js:412:35)

I'm setting: export BITCART_REVERSEPROXY=nginx-https

It's not showing up in .env after running setup but does show up in "variables passed"

root@crypto1:/home/jd/bitcart-docker# cat .env
BITCART_HOST=crypto-1.mynetwork.net
BITCART_LETSENCRYPT_EMAIL=
REVERSEPROXY_HTTP_PORT=80
REVERSEPROXY_HTTPS_PORT=443
REVERSEPROXY_DEFAULT_HOST=none
BITCART_SSH_KEY_FILE=
BITCART_SSH_AUTHORIZED_KEYS=/datadir/host_authorized_keys
BITCART_HOST_SSH_AUTHORIZED_KEYS=/root/.ssh/authorized_keys
BITCART_STORE_HOST=crypto-1.mynetwork.net
BITCART_STORE_API_URL=https://crypto-1.mynetwork.net
BITCART_ADMIN_HOST=crypto-1.mynetwork.net
BITCART_ADMIN_API_URL=https://crypto-1.mynetwork.net
BITCART_CRYPTOS=btc,bch
BTC_NETWORK=mainnet
BTC_LIGHTNING=false
BCH_NETWORK=mainnet
XRG_NETWORK=mainnet
LTC_NETWORK=mainnet
LTC_LIGHTNING=false
BSTY_NETWORK=mainnet
BSTY_LIGHTNING=false
TOR_RELAY_NICKNAME=
TOR_RELAY_EMAIL=

Logs don't show anything unusual... not sure what i missed, i'll try again soon.

@MrNaif2018
Copy link
Member

MrNaif2018 commented Feb 7, 2022

Well I see some issues with your setup, both store and admin host share same URLs
Do you want to run everything on one domain?
If so unset all unneeded variables, only BITCART_HOST, which is already set, is needed, do it like so:

unset BITCART_STORE_HOST
unset BITCART_ADMIN_HOST
unset BITCART_STORE_API_URL
unset BITCART_ADMIN_API_URL
./setup.sh

That will enable one-domain mode, so you will access the store at https://crypto-1.mynetwork.net, the admin at https://crypto-1.mynetwork.net/admin and api at https://crypto-1.mynetwork.net/api

See https://docs.bitcartcc.com/guides/one-domain-mode

P.S. That's why I always ask for config first, users are often mistaken with the domain settings. Do you know how could we clarify this more?

@Jayd603
Copy link
Author

Jayd603 commented Feb 7, 2022

Ok that worked. thank you sir.

I followed this doc, it might need updating.
https://docs.bitcartcc.com/deployment/docker

"Why was it done like so? It's because it is possible to run Merchants API on one server, and everything else on different servers.
But in most cases, you can basically do:

if https (BITCART_REVERSEPROXY=nginx-https, default)

export BITCART_ADMIN_API_URL=https://$BITCART_HOST
export BITCART_STORE_API_URL=https://$BITCART_HOST

if http (BITCART_REVERSEPROXY=nginx, local deployments, other)

export BITCART_ADMIN_API_URL=http://$BITCART_HOST
export BITCART_STORE_API_URL=http://$BITCART_HOST"

@MrNaif2018
Copy link
Member

Well it's a description of another posible usecase (onedomain mode off), but right at the top of the page it says:

Here is an example of the setup you will use in 90% cases. Replace yourdomain.tld with your actual domain (for bitcartcc demo, it was bitcartcc.com):
sudo su -
git clone https://github.com/bitcartcc/bitcart-docker
cd bitcart-docker
export BITCART_HOST=yourdomain.tld
./setup.sh

@MrNaif2018
Copy link
Member

Closing as the issue was resolved, I will look if there is something I can do with the docs
Maybe non-one-domain usage can be moved to advanced section or so

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants