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

libgobject-2.0 error #1139

Closed
RampantDespair opened this issue Nov 8, 2024 · 1 comment
Closed

libgobject-2.0 error #1139

RampantDespair opened this issue Nov 8, 2024 · 1 comment
Labels
question Questions related to rod

Comments

@RampantDespair
Copy link

RampantDespair commented Nov 8, 2024

Rod Version: v0.116.2

The code to demonstrate your question

FROM golang:1.23.3

RUN apt -y update && apt -y upgrade && apt -y install curl sudo wget

WORKDIR /app

COPY . .
RUN go mod tidy

RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt -y install ./google-chrome-stable_current_amd64.deb

RUN apt-get clean

What you got

2024-11-07 19:59:58 [launcher.Browser]2024/11/08 00:59:58 Download: https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/1321438/chrome-linux.zip
2024-11-07 19:59:58 [launcher.Browser]2024/11/08 00:59:58 Progress: 00%
2024-11-07 19:59:59 [launcher.Browser]2024/11/08 00:59:59 Progress: 32%
2024-11-07 20:00:00 [launcher.Browser]2024/11/08 01:00:00 Progress: 67%
2024-11-07 20:00:00 [launcher.Browser]2024/11/08 01:00:00 Unzip: /root/.cache/rod/browser/chromium-1321438
2024-11-07 20:00:00 [launcher.Browser]2024/11/08 01:00:00 Progress: 00%
2024-11-07 20:00:01 [launcher.Browser]2024/11/08 01:00:01 Progress: 26%
2024-11-07 20:00:02 [launcher.Browser]2024/11/08 01:00:02 Progress: 49%
2024-11-07 20:00:03 [launcher.Browser]2024/11/08 01:00:03 Progress: 94%
2024-11-07 20:00:04 [launcher.Browser]2024/11/08 01:00:04 Downloaded: /root/.cache/rod/browser/chromium-1321438
2024-11-07 20:00:05 panic: [launcher] Failed to launch the browser, the doc might help https://go-rod.github.io/#/compatibility?id=os: /root/.cache/rod/browser/chromium-1321438/chrome: error while loading shared libraries: libgobject-2.0.so.0: cannot open shared object file: No such file or directory
2024-11-07 20:00:05 exit status 2

What you expect to see

For Rod to run without issue.

What have you tried to solve the question

As shown in the above console log, rod panics and causes a system crash.
I've tried installing libgobject-2.0 but this doesn't exist apparently.
Am I doing something wrong in my Dockerfile?

@RampantDespair RampantDespair added the question Questions related to rod label Nov 8, 2024
@RampantDespair
Copy link
Author

Upon further investigation, adding || apt -f -y install to the install command worked. Not sure if this is a universal fix or issue, but this was the solution for me:

FROM golang:1.23.3

RUN apt -y update && apt -y upgrade && apt -y install curl sudo wget

WORKDIR /app

COPY . .
RUN go mod tidy

RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt -y install ./google-chrome-stable_current_amd64.deb || apt -f -y install

RUN apt-get clean

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

No branches or pull requests

1 participant