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

Exit code 141 with local agent when logs exceed certain size #1144

Closed
4 tasks done
fauust opened this issue Aug 31, 2022 · 2 comments · Fixed by #1802
Closed
4 tasks done

Exit code 141 with local agent when logs exceed certain size #1144

fauust opened this issue Aug 31, 2022 · 2 comments · Fixed by #1802
Labels
backend/local bug Something isn't working
Milestone

Comments

@fauust
Copy link
Contributor

fauust commented Aug 31, 2022

Component

server, agent, web-ui

Describe the bug

Pipeline steps will systematically fail with exit code 141 if the log size is over something between 2063600 and 2079000 bytes.

Here is how to test it.

The following pipeline will work:

pipeline:
  logs exec:
    image: bash
    commands:
      - bash -c "for i in {1..134}; do base64 /dev/urandom | head -n 200; done"

The following pipeline will not work (exit code 141):

pipeline:
  logs exec:
    image: bash
    commands:
      - bash -c "for i in {1..135}; do base64 /dev/urandom | head -n 200; done"

2063600 - 2079000 bytes range is given by:

for i in {1..134}; do base64 /dev/urandom | head -n 200; done >limit.log
stat --format="%s" limit.log
2063600
for i in {1..135}; do base64 /dev/urandom | head -n 200; done >limit.log
stat --format="%s" limit.log
2079000

This problem does not appear with docker agent, for instance, the following pipeline works without pb:

pipeline:
  generate log:
    image: debian:11-slim
    commands:
      - bash -c "for i in {1..400}; do base64 /dev/urandom | head -n 200; done"

But then, the log file seems to be trunkated to 2000000 bytes and it's impossible to download the full log from the web interface.

System Info

Server:

docker images | grep woodpecker-server
woodpeckerci/woodpecker-server   next                abdf33e30acc   35 hours ago   24.1MB

Local agent:
Run from commit 08a9915, with go run ./cmd/agent --log-level debug

Docker agent:

docker images | grep woodpecker-agent
woodpeckerci/woodpecker-agent    next                374ee61b7354   35 hours ago   13.3MB

Additional context

No response

Validations

@6543 6543 added bug Something isn't working and removed pending:bug labels Aug 31, 2022
@6543 6543 added this to the 1.0.0 milestone Aug 31, 2022
@6543
Copy link
Member

6543 commented Nov 6, 2022

at the moment we use os Pipe but we should move to a buffer instead ... we do need it anyway as soon as we start using commands as list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend/local bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants