Jenkins UI giving error “502 Bad Gateway openresty”

I have a cloud. I restarted my cloud server and I started again my docker containers.

docker ps

All my containers are working excluding Jenkins.

When I checked Jenkins on portainer

portainer

it is looking “running”

but when I want to access my Jenkins UI, I see this error

enter image description here

when I want to access with the IP address and port error is

“Connection Refused”

enter image description here

this happened to me after the update and upgrade on aws 2-3 days ago. Not jenkis, it was sonarqube. I lost 3 days looking for a solution, and after I update/upgrade the instance again, and reboot it, it’s started working normally. It was 502 bad gateway also. If you can, give it a try.
Mine was ubuntu.

4

How do you access Jenkins like http://<IPAddress>:8080 or https://<Jenins-domain>?

Since they’re not much information, let me provide some insights might be helpful for you. So, portainer and Jenkins container are running on the same server, assuming it’s an EC2. This is why you see portainer UI that Jenkins “container” status is running on 8080 port.

I assume 502 Bad Gateway issue might be caused by the changed EC2 IP so your DNS, such as Route 53 isn’t resolving to the correct IP or some plugins in the Jenkins caused the Jenkins instance broken when you restarted container although the container runs.

If IP address is not in issue, then try to:

  1. check Jenkins log using either
  • In the container tail -f /var/log/jenkins/jenkins.log
  • docker logs docker logs <YOUR CONTAINER ID>

Update any error logs in your question for any further help.

1

root@16dbd7edbf0f:/app# tail -f /var/log/jenkins/jenkins.log
tail: cannot open '/var/log/jenkins/jenkins.log' for reading: No such file or directory

there is no log records in the docker container. why I dont understand.

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

When I tried with ip address and ports (http://…:8080/)

I’m getting “connection refused”

I changed docker image names and I tried rebuild (docker build -t “imagename”). After that, I tried again “docker compose up -d” it works.

I hope it helps someone having this problem.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật