question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

502 Bad Gateway When Trying to Use LetsEncrypt/Autogenerate

See original GitHub issue

I get a 502 Bad Gateway when I include the autogenerate section of ssl below. If I comment it out and redeploy, everything works great. When I load the page, it does load with the cert over https, but it’s 502ing. Running docker logs bxlp-nginx-letsencrypt --tail 500 looks like it has the cert and says it does not need to renew it.

Here are my mup logs:

[138.197.112.225]
[138.197.112.225]> fibers@1.0.15 install /bundle/bundle/programs/server/node_modules/fibers
[138.197.112.225]> node build.js || nodejs build.js
[138.197.112.225]
[138.197.112.225]`linux-x64-46` exists; testing
[138.197.112.225]Binary is fine; exiting
[138.197.112.225]
[138.197.112.225]> meteor-dev-bundle@0.0.0 install /bundle/bundle/programs/server
[138.197.112.225]> node npm-rebuild.js
[138.197.112.225]
[138.197.112.225]
[138.197.112.225]> bcrypt@1.0.2 install /bundle/bundle/programs/server/npm/node_modules/bcrypt
[138.197.112.225]> node-pre-gyp install --fallback-to-build
[138.197.112.225]
[138.197.112.225]node-pre-gyp ERR! Tried to download: https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v46-linux-x64.tar.gz
[138.197.112.225]node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.2 and node@4.7.2 (node-v46 ABI) (falling back to source compile with node-gyp)
[138.197.112.225]make: Entering directory '/bundle/bundle/programs/server/npm/node_modules/bcrypt/build'
[138.197.112.225]  CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
[138.197.112.225]  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
[138.197.112.225]  CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
[138.197.112.225]/opt/meteord/run_app.sh: line 21:     8 Killed                  npm install --unsafe-perm

Here’s my mup.js:

module.exports = {
	servers: {
		one: {
			host: 'IPADDRESS',
			username: 'root',
			pem: 'KEYHERE'
			// password:
			// or leave blank for authenticate from ssh-agent
		}
	},
	meteor: {
		name: 'NAMEHERE',
		path: 'PATHHERE',
		servers: {
			one: {}
		},
		buildOptions: {
			serverOnly: true,
		},
		env: {
			ROOT_URL: 'https://DOMAIN.COM',
			MONGO_URL: 'mongodb://localhost/meteor'
		},
		dockerImage: 'abernix/meteord:base',
		ssl: {
			autogenerate: {
				email: 'EMAIL',
				domains: 'SUB.DOMAIN.COM'
			}
		},
		deployCheckWaitTime: 60
	},

	mongo: {
		oplog: true,
		port: 27017,
		servers: {
			one: {},
		},
	},
};

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:34 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
mackbrownecommented, Apr 6, 2017

@maxmatthews I needed this fix today. Thank you. After upgrading to a 1gb digitalOcean droplet, everything worked great. It really cut down on the random fails I’d get once in a while with the smaller droplets.

@zodern are the minimum requirements specified anywhere in the readme? It seems if autogenerate is being used, a 1gb seems to be the minimum requirement for RAM. Using ubuntu 14.04, etc. I’d be happy to write a “recommended minimum requirements” section for the readme and send you a PR? I could at least start the section for my experiences on both AWS and DigitalOcean.

1reaction
maxmatthewscommented, Feb 16, 2017

@ivanthemeh Make your own issue and post the link here and we can jump on that thread. Will make it easier for more people to follow both our issues as I think they are separate. Happy to help you once you do that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

502 Bad Gateway Error Due to Let's Encrypt Certificates ...
The problem is, this SSL-certificate-renewing process runs EVERY hour. That's WAY too often. Geez Louise. I found a fix. Go into: Home >...
Read more >
502 bad gateway after installing certbot - Help
The "Bad Gateway" is an internal problem of your application you have to fix. But I don't see a certificate problem.
Read more >
502 Bad Gateway when using Let's Encrypt with Nginx and ...
The best way to ensure that your certificate is correct is to make sure that /live contains the certificate, and that /renewal contains...
Read more >
Laravel Forge Let's Encrypt SSL 502 Bad Gateway. - Laracasts
The automatic scheduler command (that Forge generates) for renewing Let's Encrypt SSL certificates returns 502 Bad Gateway when it tries to run and...
Read more >
502 Gateway after renewing cert - Mattermost Forum
Summary Renewing expired LetsEncrypt cert results in 502 Bad Gateway Steps to reproduce docker-compose stop sudo certbot certonly ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found