Report this

What is the reason for this report?

Jenkins docker container "Bad Gateway" error

Posted on April 24, 2024

Inside our droplet cloud server we got docker containers running we recently ran out of space in our droplet and got additional volume after the server restart we have encountered an error. All of our containers were working except jenkins container The status of the container is up and when we check the status of the container on portainer it looks like it is running without issues

But when we try to access our jenkins UI it throws “502 bad gateway openresty” error and we cannot understand why

our jenkins container is using docker in docker principle

any reasons why this might be happening ? and how can we fix it?

here is my jenkins container log

root@ubuntu-c-2-4gib-fra1-01:~# docker logs 16dbd7edbf0f
    warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
          Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to https://aka.ms/aspnet/dataprotectionwarning
    warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
          No XML encryptor configured. Key {3352231c-d8ff-45a1-bf09-8fd2cf839c62} may be persisted to storage in unencrypted form.
    warn: Microsoft.EntityFrameworkCore.Query[10103]
          The query uses the 'First'/'FirstOrDefault' operator without 'OrderBy' and filter operators. This may lead to unpredictable results.
    info: Microsoft.EntityFrameworkCore.Database.Command[20101]
          Executed DbCommand (25ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
          SELECT a."Id", a."ErrorDescripton", a."Hash", a."HashStatus", a."lastUpdatedAt"
          FROM "AlgolabSessionKeys" AS a
          LIMIT 1
    warn: Microsoft.AspNetCore.Hosting.Diagnostics[15]
          Overriding HTTP_PORTS '8080' and HTTPS_PORTS ''. Binding to values defined by URLS instead 'http://*:1001'.
    info: Microsoft.Hosting.Lifetime[14]
          Now listening on: http://[::]:1001
    info: Microsoft.Hosting.Lifetime[0]
          Application started. Press Ctrl+C to shut down.
    info: Microsoft.Hosting.Lifetime[0]
          Hosting environment: Production
    info: Microsoft.Hosting.Lifetime[0]
          Content root path: /app
    info: Microsoft.Hosting.Lifetime[0]
          Application is shutting down...
    warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
          Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed. For more information go to https://aka.ms/aspnet/dataprotectionwarning
    warn: Microsoft.EntityFrameworkCore.Query[10103]
          The query uses the 'First'/'FirstOrDefault' operator without 'OrderBy' and filter operators. This may lead to unpredictable results.
    info: Microsoft.EntityFrameworkCore.Database.Command[20101]
          Executed DbCommand (23ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
          SELECT a."Id", a."ErrorDescripton", a."Hash", a."HashStatus", a."lastUpdatedAt"
          FROM "AlgolabSessionKeys" AS a
          LIMIT 1
    warn: Microsoft.AspNetCore.Hosting.Diagnostics[15]
          Overriding HTTP_PORTS '8080' and HTTPS_PORTS ''. Binding to values defined by URLS instead 'http://*:1001'.
    info: Microsoft.Hosting.Lifetime[14]
          Now listening on: http://[::]:1001
    info: Microsoft.Hosting.Lifetime[0]
          Application started. Press Ctrl+C to shut down.
    info: Microsoft.Hosting.Lifetime[0]
          Hosting environment: Production
    info: Microsoft.Hosting.Lifetime[0]
          Content root path: /app


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

The 502 error is a generic error that just indicates that the client service is unable to connect to the backend service but it does not really give the actual error causing the problem.

What I could suggest is checking the logs of the container to see if you can spot the actual problem causing the issue:

docker logs [jenkins-container-id]

Feel free to share the errors from the logs here as well.

Also, have you tried restarting the container to see if this fixes the problem:

docker restart [jenkins-container-id]

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.