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

Air running in compose fails to start because of "too many open files" #685

Open
lays147 opened this issue Nov 13, 2024 · 1 comment
Open

Comments

@lays147
Copy link

lays147 commented Nov 13, 2024

Hi, I need some guidance.
I'm running air in a docker container, and since +/- a week ago I'm unable to start my containers with the error:

api-1  | 
api-1  |   __    _   ___  
api-1  |  / /\  | | | |_) 
api-1  | /_/--\ |_| |_| \_ v1.61.1, built with Go go1.23.1
api-1  | 
api-1  | 2024/11/13 13:56:59 too many open files

I did not add new files to the project.
If I start air from my terminal (using version v1.60.0), this error does not happen. However, I need the configuration on the compose for my application to work properly.

The same behavior happens using the cosmtrek/air image.

FROM golang:1.23 AS dev

WORKDIR /app

COPY go.mod go.sum ./

RUN go install github.com/air-verse/air@latest

COPY . .

FROM dev as api
ENV PORT=8000

EXPOSE ${PORT}

CMD ["air", "-c", ".air.toml"]

I tried the following golang images trying to figure out if this was an image issue:

  • golang:1.23
  • golang:1.23.2
  • golang:1.23.1
  • golang:1.23-alpine
  • golang:1.23-bullseye

Is there any guidance on how to debug to find the root cause of this issue?

@istyf
Copy link

istyf commented Nov 14, 2024

I don't run air in docker so I can't help you there, but I have experienced the "too many open files" problem in other projects. It is docker that outputs this message and it seems to have different cures depending on your host platform (Mac, windows, linux). Have you updated docker recently? A new version might behave differently, causing this error to appear all of a sudden.

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

2 participants