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

Issues with Heroku and Good Job #184

Closed
duartemvix opened this issue Dec 28, 2020 · 3 comments
Closed

Issues with Heroku and Good Job #184

duartemvix opened this issue Dec 28, 2020 · 3 comments

Comments

@duartemvix
Copy link

duartemvix commented Dec 28, 2020

I've been getting stuck Heroku deployments upon setting GOOD_JOB_EXECUTION_MODE=async. Immediately after changing it to either external or inline it begins deploying normally back again.

My deployments just simply were never completing in time as I would have them before. To reproduce this issue I believe all you have to do is just: Deploy an API Rails app to Heroku and install Good Job. Without any assets it should finish quickly. But upon setting it to async I believe you'll stumble upon this issue I'm referencing here.

I should also add that: The first time I deployment with GOOD_JOB_EXECUTION_MODE=async it actually worked just fine. I believe something went wrong after I ran a Heroku bash session and accessed Rails console with heroku run rails c then I deployed right after that to get this issue.

I didn't have enough time to be sure if whether this is with Good Job or if it regards Heroku's Ruby build pack. But I just wanted to first call your attention here and find a solution when I have more time later.

I've been actually pretty motivated to use async as I was reading your very well documented README. I still got Good Job working and it feels great. Much better than managing all Redis configuration for my small app.

image

@bensheldon
Copy link
Owner

bensheldon commented Dec 28, 2020

@duartemvix thanks for opening this Issue! Async is a tad rough but I hope I can unblock you.

The reliable solution right now is to only use async in your web process (and not as a global environment variable, which can cause the job executor to startup during asset compilation, migrations, and other times you wouldn't want to be executing jobs).

Eg, only set async mode in your procfile:

# Procfile

web: GOOD_JOB_EXECUTION_MODE=async bin/rails s

@duartemvix
Copy link
Author

@duartemvix thanks for opening this Issue! Async is a tad rough but I hope I can unblock you.

The reliable solution right now is to only use async in your web process (and not as a global environment variable, which can cause the job executor to startup during asset compilation, migrations, and other times you wouldn't want to be executing jobs).

Eg, only set async mode in your procfile:

# Procfile

web: GOOD_JOB_EXECUTION_MODE=async bin/rails s

Oh, okay. I'll try that!

@vertis
Copy link

vertis commented Mar 22, 2021

I know this issue is closed, but it's worth mentioning that if you enable async in the config and then deploy to Heroku before any of the migrations have been run the asset compilation will fail (trying to find the database tables).

The above solution works (only enabling in the Procfile). It might be worth mentioning this in the async part of the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants