Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

EB docker environment Nginx 502 gateway errors #140

Closed
TheodoreCha opened this issue Feb 21, 2022 · 5 comments
Closed

EB docker environment Nginx 502 gateway errors #140

TheodoreCha opened this issue Feb 21, 2022 · 5 comments

Comments

@TheodoreCha
Copy link

Anyone has experienced that 502 gateway errors with this gem? After installing this gem, it raise nginx 502 errors. Hard to find any relevant logs regarding this issue.

@joeyparis
Copy link
Collaborator

Are you getting the 502 error on your Web Server or on your Worker Server?

@TheodoreCha
Copy link
Author

TheodoreCha commented Feb 22, 2022

@joeyparis Thanks for the message. I resolved the 502 issue but still facing another issue.

Environment

EB

  • Both web and worker are dockerized
  • EB web env staging - Does not have PROCESS_ACTIVE_ELASTIC_JOBS
  • EB worker env staging - PROCESS_ACTIVE_ELASTIC_JOBS = true
  • Both have the same code base

SQS

  • Correct

Issues

  • I triggered a job but it does not invoke while the SQS monitor react to the trigger and increase the number of messages available

image

Can someone teach me how to solve this issue?

@joeyparis
Copy link
Collaborator

What ports do you have exposed on the worker environment? Was the worker functioning prior to installing the gem or are you using this gem to get a worker in the first place? I apologize as I'm not as familiar with the Docker portion of the gem but I'll help how I can!

@TheodoreCha
Copy link
Author

Hi Joey,
Thank you for your support.

  • What ports do you have exposed on the worker environment?
    I made a simple database created in order to test the job work.

  • Was the worker functioning prior to installing the gem or are you using this gem to get a worker in the first place?
    I have just confirmed that the job works in the development

  • I found a log in the web app. it triggers the job.
    [ActiveJob] Enqueued SendInvitationToSupplierJob (Job ID: 97ae9a44-dda8-4c5e-aae5-4b66ae40b2ed) to ActiveElasticJob(active_job_demo) with arguments: "hi"

  • In the worker app, I can not find any log regarding the job.

I am crying now

@joeyparis
Copy link
Collaborator

What ports do you have exposed on the worker environment?

I made a simple database created in order to test the job work.

Are you deploying the same rails application code to both the web-env and worker-env? They should both be the same with the exception of the ENV variables. I'm not super familiar with the docker setup but you probably need to expose port 80 on the container so that Elastic Beanstalk's sqsd is able to publish the requests to the application. My guess is this is why jobs aren't processing but also why you're not seeing any errors.

Was the worker functioning prior to installing the gem or are you using this gem to get a worker in the first place?

I have just confirmed that the job works in the development

When testing it in development are you also using SQS (or the localstack equivalent?)

I found a log in the web app. it triggers the job.
[ActiveJob] Enqueued SendInvitationToSupplierJob (Job ID: 97ae9a44-dda8-4c5e-aae5-4b66ae40b2ed) to ActiveElasticJob(active_job_demo) with arguments: "hi"

This makes sense as the job is reaching the SQS queue, so the problem is definitely in the worker. I would see if you can find any logs for the sqsd process in the worker environment.

@active-elastic-job active-elastic-job locked and limited conversation to collaborators Feb 22, 2022
@joeyparis joeyparis converted this issue into discussion #141 Feb 22, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

2 participants