Woodpecker is a community fork of the Drone CI system.

Woodpecker



Woodpecker

Woodpecker is a community fork of the Drone CI system.

woodpecker

Support

Please consider to donate and become a backer. 🙏 [Become a backer]

Usage

.woodpecker.yml

  • Place your pipeline in a file named .woodpecker.yml in your repository
  • Pipeline steps can be named as you like
  • Run any command in the commands section
# .woodpecker.yml
pipeline:
  build:
    image: debian
    commands:
      - echo "This is the build step"
  a-test-step:
    image: debian
    commands:
      - echo "Testing.."

Build steps are containers

  • Define any Docker image as context
  • Install the needed tools in custom Docker images, use them as context
 pipeline:
   build:
-    image: debian
+    image: mycompany/image-with-awscli
     commands:
       - aws help

File changes are incremental

  • Woodpecker clones the source code in the beginning pipeline
  • Changes to files are persisted through steps as the same volume is mounted to all steps
# .woodpecker.yml
pipeline:
  build:
    image: debian
    commands:
      - touch myfile
  a-test-step:
    image: debian
    commands:
      - cat myfile

Plugins are straightforward

  • If you copy the same shell script from project to project
  • Pack it into a plugin instead
  • And make the yaml declarative
  • Plugins are Docker images with your script as an entrypoint
# Dockerfile
FROM laszlocloud/kubectl
COPY deploy /usr/local/deploy
ENTRYPOINT ["/usr/local/deploy"]
# deploy
kubectl apply -f $PLUGIN_TEMPLATE
# .woodpecker.yml
pipeline:
  deploy-to-k8s:
    image: laszlocloud/my-k8s-plugin
    template: config/k8s/service.yml

Documentation

https://woodpecker-ci.github.io/

Who uses Woodpecker?

Currently, I know of one organization using Woodpecker. With 50+ users, 130+ repos and more than 1100 builds a week.

Leave a comment if you're using it.

Contribution

See Contributing Guide

License

Woodpecker is Apache 2.0 licensed with the source files in this repository having a header indicating which license they are under and what copyrights apply.

Files under the docs/ folder are licensed under Creative Commons Attribution-ShareAlike 4.0 International Public License.

Owner
Woodpecker CI
Woodpecker is a community fork of the Drone CI system.
Woodpecker CI
Comments
  • Feedback: UI :speech_balloon:

    Feedback: UI :speech_balloon:

    Summary of UI issues and smaller changes (based on new UI from #245) which can be posted as comments. For complex improvements please open a separate issue.

    UI improvements

    • [x] improve responsive (mobile) usage
    • [x] improve darkmode favicon #576
    • [x] favicon to show pipeline status #576
    • [x] use textarea for secret values (to support long texts like ssh keys) #574
    • [x] show PR name / id instead of target branch if ref: refs/pull/xxx/merge
    • [x] Show matrix options in build view #526
    • [x] add page /<user-or-group-name> to view all enabled woodpecker repos of a user / group
    • [x] use icons for build proc status (currently just colored points)

    UI bugs

    • [x] #469
    • [x] fix overflowing commit messages #528
    • [x] fix back button (direct page load) to go back in history or to some default if history is empty #529
    • [x] fix new build updates not being used / send (new builds are not added list)
    • [x] fix flickering when adding new log-lines while step is running

    Next Round: #1314

  • Add ability to trigger manual builds

    Add ability to trigger manual builds

    closes #83 closes #240

    Changelog:

    • [x] UI: button to trigger manual build
    • [x] SERVER: ability to inject variables for a specific build
    • [x] SERVER: trigger action for build
    • [x] Updated gitea dep to allow darwin builds
    • [x] UI: style the form & localization
    • [x] SERVER: auto extract of last commit id of branch
    • [x] SERVER: debug why adding a new event "manual" leads to only clone step being run
    • [x] Error handling for api endpoint
    • [x] MIssing fields for build
    • [x] Persist variables on build restart
    • [x] cli command
    • [x] find a home for ManualBuildReq
    • [x] security checks
    • [x] hide button if not available to user
  • Rewrite of UI

    Rewrite of UI

    closes #246 closes #229 closes #266 closes #203 closes #191

    Idea

    Rewrite of the UI using Typescript, Vue3, Windicss (similar to Tailwind) and Vite. The design should be close to the current one with some changes:

    • latest pipeline in a sidebar on the right
    • secrets and registry as part of the repo-settings (secrets and registry entries shouldn't be used as much so they can be "hidden" under settings IMO)
    • start page shows list of active repositories with button to enable / add new ones (currently you see all repositories and in most cases you only add new repositories once in a while)

    TODO

    • authentication
      • [x] login
      • [x] logout
      • [x] login error page
      • [x] handle token errors and re-login (an expired token will be removed by server, so no need to handle it by hand)
    • own repo list
      • [x] show active repos
      • [x] show button to activate more repos
    • add new repo
      • [x] list inactive & active repos
    • repo overview
      • [x] show builds
      • [x] show current build status (badge)
      • [x] link vcs
      • [x] show list of active branches
    • build details
      • [x] show jobs
      • [x] show job logs
      • [x] show details (since, duration)
      • [x] link commit
      • [x] build actions (cancel / re-start pipeline)
      • [x] approve / decline pipeline
      • [x] ~~show artifacts and download links~~
    • repo settings
      • [x] secrets
      • [x] registry
      • [x] delete / deactivate repo
      • [x] general settings
    • user settings
      • [x] show own token / cli setup
    • layout
      • build-feed (right sidebar)
        • [x] open / close
        • [x] improve item view
        • [x] listen to updates
        • [x] ~~add search to filter by repo, commit message~~
      • navbar
        • [x] show amount of currently active & pending pipelines (click on it to open / close sidebar)
    • permissions
      • [x] show login button if not authenticated
      • [x] don't show hidden repos (redirect if access)
      • [x] don't show buttons / views if missing permissions
        • [x] settings
        • [x] hide active jobs & sidebar if not authenticated
        • [x] build actions (restart, cancel, ...)
    • ci (add some new ci jobs)
      • [x] check format with prettier
      • [x] check linting
      • [x] check types
    • misc
      • [x] link docs
      • [x] show current version
      • [x] icons
      • [x] confirm dialogs
      • [x] add toast for every save / await call
      • [x] support emojis in commit-messages
      • [x] handle errors and toast them
      • [x] add some eslint config
      • [x] allow to set docs url again
      • [x] fix tabs
      • [x] check color contrasts
      • [x] running gif need transparent background
      • [x] increment time of running builds
      • [x] show no builds in sidebar if empty
      • [x] only show "own" repos in repo-add and repo-list (repos you have at least push access to) #476
      • [x] add search for repo list

    Before merging

    This PR includes some changes introduced by following PRs. So they have to be merged before this one gets merged.

    • [x] #251
    • [x] #248
    • [x] #434
    • [x] #437
    • [x] #436

    Follow Ups

    • remove WithDocs
    • remove template execution for index.html => simply serve static file

    Screenshots

    Peek 2021-10-26 22-34

    Screenshot from 2021-09-19 00-17-24 Screenshot from 2021-09-19 00-16-46 Screenshot from 2021-09-19 00-16-26

    Screenshot from 2021-09-19 21-52-55

  • Add support for path-prefix condition

    Add support for path-prefix condition

    Example:

    ...
    when:
      path: '*.md'
    

    should match only builds in which the commit added/removed or modified files with the *.md extension

    This works for new builds, but not for restarts of existing builds (as I didn't add a field to the builds table in meddler).

    If you think this makes sense, can you advise how to deal with a ddl migration?

    cc: @ksvital: this might simplify a bit our pipelines

  • Add plugin marketplace (for official plugins)

    Add plugin marketplace (for official plugins)

    closes #315

    Peek 2021-10-16 18-22

    List of Plugins is fetched on each build of the documentation. Plugins are search by this query string:

    // search for repos in woodpecker-ci org with the topic: woodpecker-plugin including forks
    
    org:woodpecker-ci topic:woodpecker-plugin fork:true
    

    https://github.com/search?q=org%3Awoodpecker-ci+filename%3Adocs.md+WOODPECKER_PLUGIN_DOCS

    You can find a sample documentation for a plugin here: https://github.com/woodpecker-ci/plugin-demo/blob/main/docs.md

    Preview

    https://extra-small-jelly.surge.sh/plugins

  • Can't login in Woodpecker 0.12.0+

    Can't login in Woodpecker 0.12.0+

    Can't login in Woodpecker with user/pass and Gitea when using Woodpecker after 0.11.0 release: 0.12.0, 0.13.0 and latest not working.

    My configuration:

          - DRONE_GITEA=true
          - DRONE_GITEA_URL=https://gitea.domain.com
          - DRONE_ADMIN=my_gitea_user
    

    Error message:

    time="2021-05-25T20:55:06Z" level=error msg="cannot authenticate user. 403 Forbidden"
    

    0.11.0 works without problems. Thanks!

  • Add cron jobs

    Add cron jobs

    TODOs

    Backend

    • [x] #949 got merged
    • [x] use https://github.com/robfig/cron to parse next schedule
    • [x] add api
    • [x] scheduler work
    • [x] set a default event filter (push, tag, pull, deploy) #1140
    • [x] add "cron" name filter

    Frontend

    • [x] add ui
    • [x] mention time is in UTC
    • [x] Set clock-icon as avatar if cron task
    • [x] hide refs/heads/ part in build-list-view as done with others

    CLI

    • [x] extend client sdk
    • [x] add cli subcomand
    • [x] ls works
    • [x] add works
    • [x] update works
    • [x] info works
    • [x] rm works

    Docs

    • [x] add docs
    • [x] mention default event filter (push, tag, pull, deploy)

    Tests

    • [x] unit tests
    • [x] ~~integration tests~~

    Related refs

    • https://docs.drone.io/pipeline/docker/syntax/trigger/#by-cron
    • handle timezones (https://blog.fuzzymistborn.com/drone-love-hate/)

    Follow UP

    • Button to trigger a run now

    close #8

  • Fix repository sync aborts after a signle repo failed

    Fix repository sync aborts after a signle repo failed

    This PR fixes the issue, where the whole repository sync process would be canceled if only one repository fails to sync. It thereby partly fixes, or circumvents, #648 as described (see item 1).

    In order to display an additional status/error message after syncing, I had to change the API response types/schemas to include an optional message string (see RepoList types both in the frontend and the server). I'm not 100% happy with how I named that type though.

  • Step cancelled without reason

    Step cancelled without reason

    I am trying to build and publish Docker image using Dockerfile. I have a repository in Gitea. I am getting a "The step has been cancelled" error for the clone step. Please find the screenshot below.

    image

    Here is my pipeline

    pipeline:
      publish:
        image: plugins/docker
        group: docker
        secrets: [ docker_username, docker_password ]
        settings:
          repo: dockerregistry/reponame
          dockerfile: Dockerfile
          tag: latest
        when:
          branch: master
          event: push
    

    Am I missing or doing anything wrong?

    Originally posted by @rajaseg in https://github.com/woodpecker-ci/woodpecker/issues/795#issuecomment-1051652122

  • Add support for pipeline root.when conditions

    Add support for pipeline root.when conditions

    close #283 close #688

    As a ci user I would like to set a file/yaml global when condition, to disable pipeline runs. This allows easier to write control for the pipeline events, branches and metadata.

    Changes

    • [x] add root when conditions:
      • [x] branch
      • [x] repo
      • [x] event
      • [x] tag
      • [x] platform
      • [x] instance
      • [x] path
    • [x] add docs
    • [x] update yaml schema
    • [x] wait for #686

    Fixes

    1. In hook.go, when one of the yaml(s) was filtered by branch the hook would not fire. Changed to if all are filtered hook is not fired.
    2. changed function name 'branchFiltered' -> 'checkIfFiltered'
  • WOODPECKER_GITEA_SKIP_VERIFY is no effect

    WOODPECKER_GITEA_SKIP_VERIFY is no effect

    Component

    server

    Describe the bug

    I set both WOODPECKER_GITEA_SKIP_VERIFY=true and DRONE_GITEA_SKIP_VERIFY=true in docker environment but still get the error x509: certificate signed by unknown authority . My server is using cert sign by Encryption Everywhere DV TLS CA - G1. Any help?

    System Info

    {"source":"https://github.com/woodpecker-ci/woodpecker","version":"v0.14.3"}
    

    Additional context

    time="2021-12-13T09:27:56Z" level=error msg="cannot authenticate user. Post \"https://******/login/oauth/access_token\": x509: certificate signed by unknown authority"
    

    Validations

  • gitea-release plugin

    gitea-release plugin

    Clear and concise description of the problem

    Please provide an official gitea-release plugin

    Suggested solution

    start with a fork of https://github.com/drone-plugins/drone-gitea-release

    Alternative

    use the drone plugin

    Additional context

    No response

    Validations

    • [X] Read the Contributing Guidelines.
    • [X] Read the docs.
    • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
  • default privileged plugins also are privileged when used as normal images

    default privileged plugins also are privileged when used as normal images

    e.g. https://github.com/woodpecker-ci/woodpecker/blob/f1e9c8416dafb6c236694765d9f7dde9620592da/shared/constant/constant.go#L17-L23

    should only have privileged permissions in plugin usage ...

    else you could use custom commands to escape jail


    bounty 50$

  • SSH runner does not execute, it just seems to disconnect

    SSH runner does not execute, it just seems to disconnect

    Component

    agent

    Describe the bug

    With the changes made as described in https://github.com/woodpecker-ci/woodpecker/issues/1523 by shifting some lines down The SSH agent starts and connects but then seems unable to do anything, journal logs on agent system:

     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/runner.go:97","message":"received execution"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/runner.go:111","message":"listen for cancel signal"}
     woodpecker-agent[224863]: {"level":"debug","ID":"169","Repo":"myuser/ci-test2","Pipeline":"9","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/pipeline/pipeline.go:75","message":"Executing 2 stages, in order of:"}
     woodpecker-agent[224863]: {"level":"debug","ID":"169","Repo":"myuser/ci-test2","Pipeline":"9","Stage":"wp_0_2276890056050444553_clone","Steps":"wp_0_2276890056050444553_clone","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/pipeline/pipeline.go:85","message":"stage"}
     woodpecker-agent[224863]: {"level":"debug","ID":"169","Repo":"myuser/ci-test2","Pipeline":"9","Stage":"wp_0_2276890056050444553_stage_0","Steps":"wp_0_2276890056050444553_step_0","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/pipeline/pipeline.go:85","message":"stage"}
     woodpecker-agent[224863]: {"level":"debug","ID":"169","Repo":"myuser/ci-test2","Pipeline":"9","Step":"wp_0_2276890056050444553_clone","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/pipeline/pipeline.go:157","message":"Prepare"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","image":"docker.io/woodpeckerci/plugin-git:2.0","stage":"clone","exit_code":0,"exited":false,"time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/tracer.go:51","message":"update step status"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","image":"docker.io/woodpeckerci/plugin-git:2.0","stage":"clone","exit_code":0,"exited":false,"time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/tracer.go:59","message":"update step status complete"}
     woodpecker-agent[224863]: {"level":"debug","ID":"169","Repo":"myuser/ci-test2","Pipeline":"9","Step":"wp_0_2276890056050444553_clone","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/pipeline/pipeline.go:184","message":"Executing"}
     woodpecker-agent[224863]: {"level":"debug","ID":"169","Repo":"myuser/ci-test2","Pipeline":"9","Step":"wp_0_2276890056050444553_clone","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/pipeline/pipeline.go:190","message":"Complete"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","image":"docker.io/woodpeckerci/plugin-git:2.0","stage":"clone","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/logger.go:53","message":"log stream opened"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","image":"docker.io/woodpeckerci/plugin-git:2.0","stage":"clone","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/logger.go:61","message":"log stream copied"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","image":"docker.io/woodpeckerci/plugin-git:2.0","stage":"clone","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/logger.go:77","message":"log stream uploading"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","image":"docker.io/woodpeckerci/plugin-git:2.0","stage":"clone","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/logger.go:81","message":"log stream upload complete"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","image":"docker.io/woodpeckerci/plugin-git:2.0","stage":"clone","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/logger.go:85","message":"log stream closed"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","image":"docker.io/woodpeckerci/plugin-git:2.0","stage":"clone","error":"read tcp 192.168.5.100:54050->192.168.5.32:22: use of closed network connection","exit_code":126,"exited":true,"time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/tracer.go:51","message":"update step status"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","image":"docker.io/woodpeckerci/plugin-git:2.0","stage":"clone","error":"read tcp 192.168.5.100:54050->192.168.5.32:22: use of closed network connection","exit_code":126,"exited":true,"time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/tracer.go:59","message":"update step status complete"}
     woodpecker-agent[224863]: {"level":"debug","ID":"169","Repo":"myuser/ci-test2","Pipeline":"9","Step":"wp_0_2276890056050444553_step_0","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/pipeline/pipeline.go:157","message":"Prepare"}
     woodpecker-agent[224863]: {"level":"debug","ID":"169","Repo":"myuser/ci-test2","Pipeline":"9","Step":"wp_0_2276890056050444553_step_0","error":"read tcp 192.168.5.100:54050->192.168.5.32:22: use of closed network connection","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/pipeline/pipeline.go:164","message":"Skipped due to OnFailure=false"}
     woodpecker-agent[224863]: {"level":"error","ID":"169","Repo":"myuser/ci-test2","Pipeline":"9","error":"read tcp 192.168.5.100:54050->192.168.5.32:22: use of closed network connection","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/pipeline/pipeline.go:90","message":"could not destroy engine"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","error":"read tcp 192.168.5.100:54050->192.168.5.32:22: use of closed network connection","exit_code":1,"canceled":false,"time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/runner.go:185","message":"pipeline complete"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/runner.go:187","message":"uploading logs"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/runner.go:189","message":"uploading logs complete"}
     woodpecker-agent[224863]: {"level":"debug","repo":"myuser/ci-test2","pipeline":"9","id":"169","error":"read tcp 192.168.5.100:54050->192.168.5.32:22: use of closed network connection","exit_code":1,"time":"2023-01-03T22:30:44Z","caller":"github.com/woodpecker-ci/woodpecker/agent/runner.go:194","message":"updating pipeline status"}
    

    Woodpecker log shows only this in red:

    Execution errorread tcp 192.168.5.100:54050->192.168.5.32:22: use of closed network connection
    

    SSH server journal shows this:

     dbus-daemon[652]: [system] Activating via systemd: service name='org.freedesktop.home1' unit='dbus-org.freedesktop.home1.service' requested by ':1.68' (uid=0 pid=14585 comm="sshd: *** [priv]")
     dbus-daemon[652]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.home1.service': Unit dbus-org.freedesktop.home1.service not found.
     sshd[14585]: pam_systemd_home(sshd:auth): systemd-homed is not available: Unit dbus-org.freedesktop.home1.service not found.
     audit[14585]: USER_AUTH pid=14585 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:authentication grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     kernel: audit: type=1100 audit(1672785409.284:378): pid=14585 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:authentication grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     audit[14585]: USER_ACCT pid=14585 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting grantors=pam_access,pam_unix,pam_permit,pam_time acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     sshd[14585]: Accepted password for *** from 192.168.5.100 port 33788 ssh2
     audit[14585]: CRED_ACQ pid=14585 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     audit[14585]: SYSCALL arch=c000003e syscall=1 success=yes exit=4 a0=3 a1=7ffd03430540 a2=4 a3=7ffd03430254 items=0 ppid=719 pid=14585 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=31 comm="sshd" exe="/usr/bin/sshd" key=(null)
     audit: PROCTITLE proctitle=737368643A20646973636F7264205B707269765D
     sshd[14585]: pam_unix(sshd:session): session opened for user ***(uid=1000) by (uid=0)
     kernel: audit: type=1101 audit(1672785409.290:379): pid=14585 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting grantors=pam_access,pam_unix,pam_permit,pam_time acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     kernel: audit: type=1103 audit(1672785409.290:380): pid=14585 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     kernel: audit: type=1006 audit(1672785409.290:381): pid=14585 uid=0 old-auid=4294967295 auid=1000 tty=(none) old-ses=4294967295 ses=31 res=1
     kernel: audit: type=1300 audit(1672785409.290:381): arch=c000003e syscall=1 success=yes exit=4 a0=3 a1=7ffd03430540 a2=4 a3=7ffd03430254 items=0 ppid=719 pid=14585 auid=1000 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=31 comm="sshd" exe="/usr/bin/sshd" key=(null)
     kernel: audit: type=1327 audit(1672785409.290:381): proctitle=737368643A20646973636F7264205B707269765D
     systemd-logind[659]: New session 31 of user ***.
    -- Subject: A new session 31 has been created for user ***
    -- Defined-By: systemd
    -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- Documentation: sd-login(3)
    --
    -- A new session with the ID 31 has been created for the user ***.
    --
    -- The leading process of the session is 14585.
     systemd[1]: Started Session 31 of User ***.
    -- Subject: A start job for unit session-31.scope has finished successfully
    -- Defined-By: systemd
    -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- A start job for unit session-31.scope has finished successfully.
    --
    -- The job identifier is 2931.
     audit[14585]: USER_START pid=14585 uid=0 auid=1000 ses=31 msg='op=PAM:session_open grantors=pam_loginuid,pam_keyinit,pam_systemd_home,pam_limits,pam_unix,pam_permit,pam_mail,pam_systemd,pam_env acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     audit[14587]: CRED_ACQ pid=14587 uid=0 auid=1000 ses=31 msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     kernel: audit: type=1105 audit(1672785409.327:382): pid=14585 uid=0 auid=1000 ses=31 msg='op=PAM:session_open grantors=pam_loginuid,pam_keyinit,pam_systemd_home,pam_limits,pam_unix,pam_permit,pam_mail,pam_systemd,pam_env acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     kernel: audit: type=1103 audit(1672785409.327:383): pid=14587 uid=0 auid=1000 ses=31 msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     sshd[14585]: pam_unix(sshd:session): session closed for user ***
     audit[14585]: USER_END pid=14585 uid=0 auid=1000 ses=31 msg='op=PAM:session_close grantors=pam_loginuid,pam_keyinit,pam_systemd_home,pam_limits,pam_unix,pam_permit,pam_mail,pam_systemd,pam_env acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     audit[14585]: CRED_DISP pid=14585 uid=0 auid=1000 ses=31 msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     kernel: audit: type=1106 audit(1672785409.390:384): pid=14585 uid=0 auid=1000 ses=31 msg='op=PAM:session_close grantors=pam_loginuid,pam_keyinit,pam_systemd_home,pam_limits,pam_unix,pam_permit,pam_mail,pam_systemd,pam_env acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     kernel: audit: type=1104 audit(1672785409.390:385): pid=14585 uid=0 auid=1000 ses=31 msg='op=PAM:setcred grantors=pam_shells,pam_faillock,pam_permit,pam_faillock acct="***" exe="/usr/bin/sshd" hostname=192.168.5.100 addr=192.168.5.100 terminal=ssh res=success'
     systemd[1]: session-31.scope: Deactivated successfully.
    -- Subject: Unit succeeded
    -- Defined-By: systemd
    -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- The unit session-31.scope has successfully entered the 'dead' state.
     systemd-logind[659]: Session 31 logged out. Waiting for processes to exit.
     systemd-logind[659]: Removed session 31.
    -- Subject: Session 31 has been terminated
    -- Defined-By: systemd
    -- Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
    -- Documentation: sd-login(3)
    --
    -- A session with the ID 31 has been terminated.
    

    Actually whilst getting the debug info for this bug it seems it also sometimes shows this error instead:

    woodpecker-agent[225222]: {"level":"error","error":"rpc error: code = Unknown desc = Step finished with exitcode 1, Process exited with status 127","time":"2023-01-03T22:35:25Z","caller":"github.com/woodpecker-ci/woodpecker/pipeline/rpc/client_grpc.go:97","message":"grpc error: wait(): code: Unknown: rpc error: code = Unknown desc = Step finished with exitcode 1, Process exited with status 127"}
    

    I've tried both ssh authentication using username and password and authenticated key - same issue.

    System Info

    source	"https://github.com/woodpecker-ci/woodpecker"
    version	"dev"
    
    (git commit ID for build is the latest, f1e9c8416dafb6c236694765d9f7dde9620592da, built on arch linux by using the woodpecker-agent-git aur package)
    

    Additional context

    No response

    Validations

  • SSH runner crashes on start up

    SSH runner crashes on start up

    Component

    agent

    Describe the bug

    It seems that there is an issue with the ssh runner backend, it crashes upon starting with the following log:

     woodpecker-agent[212270]: {"level":"info","time":"2023-01-03T21:56:07Z","message":"Starting Woodpecker agent with version 'dev' and backend 'ssh' running up to 1 pipelines in parallel"}
     woodpecker-agent[212270]: panic: runtime error: invalid memory address or nil pointer dereference
     woodpecker-agent[212270]: [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5649917a0c44]
     woodpecker-agent[212270]: goroutine 36 [running]:
     woodpecker-agent[212270]: github.com/woodpecker-ci/woodpecker/pipeline/backend/ssh.(*ssh).Load(0xc0003d4390)
     woodpecker-agent[212270]:         github.com/woodpecker-ci/woodpecker/pipeline/backend/ssh/ssh.go:49 +0xa4
     woodpecker-agent[212270]: main.loop.func3()
     woodpecker-agent[212270]:         github.com/woodpecker-ci/woodpecker/cmd/agent/agent.go:156 +0xd1
     woodpecker-agent[212270]: created by main.loop
     woodpecker-agent[212270]:         github.com/woodpecker-ci/woodpecker/cmd/agent/agent.go:152 +0x10e9
     systemd[1]: woodpecker-agent.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
    

    Where line 49 is (and showing some later code in this function):

    func (e *ssh) Load() error {
    	cmd, err := e.client.Command("/bin/env", "mktemp", "-d", "-p", "/tmp", "woodpecker-ssh-XXXXXXXXXX")
    	if err != nil {
    		return err
    ...
    client, err := goph.New(user, address, auth)
    	if err != nil {
    		return err
    	}
    	e.client = client
    	return nil
    }
    

    It looks like e.client is being used before it is set, which happens later on in the code. Moving the top part of the function to the bottom prevents the crash, although ssh does still not work (will raise another bug for that)

    System Info

    source	"https://github.com/woodpecker-ci/woodpecker"
    version	"dev"
    
    (git commit ID for build is the latest, f1e9c8416dafb6c236694765d9f7dde9620592da, built on arch linux by using the woodpecker-agent-git aur package)
    

    Additional context

    No response

    Validations

  • stream: not found/rpc server could not write to logger

    stream: not found/rpc server could not write to logger

    Component

    server

    Describe the bug

    When trying to view logs for a job (that has a green dot), the web interface states "an unknown error has occured".

    The server log (via docker-compose) is full with messages like these:

    woodpecker-server_1  | {"level":"error","error":"stream: not found","time":"2023-01-02T14:11:42Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/grpc/rpc.go:382","message":"rpc server could not write to logger"}
    
    woodpecker-server_1  | {"level":"debug","time":"2023-01-02T14:11:32Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/api/stream.go:171","message":"log stream: connection opened"}
    woodpecker-server_1  | {"level":"error","error":"stream: not found","time":"2023-01-02T14:11:32Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/api/stream.go:196","message":"tail of logs failed"}
    woodpecker-server_1  | {"level":"debug","time":"2023-01-02T14:11:32Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/api/stream.go:176","message":"log stream: connection closed"}
    

    And:

    woodpecker-server_1  | {"level":"error","error":"Error #01: sql: no rows in result set\n","ip":"1....9","latency":1.850754,"method":"GET","path":"/api/repos/.../.../logs/203/4","status":404,"time":"2023-01-02T14:11:38Z","user-agent":"Mozilla/5....Firefox/108.0","time":"2023-01-02T14:11:38Z","caller":"/woodpecker/src/github.com/woodpecker-ci/woodpecker/server/router/middleware/logger.go:43"}
    

    The agent log also logs an error:

    woodpecker-agent_1  | {"level":"error","error":"io: read/write on closed pipe","time":"2023-01-02T14:10:38Z","message":"copy limited logStream part"}
    

    System Info

    {"source":"https://github.com/woodpecker-ci/woodpecker","version":"0.15.6"}
    

    Additional context

    afbeelding

    Validations

Woodpecker CI plugin to build multiarch Docker images with buildx

plugin-docker-buildx Woodpecker CI plugin to build multiarch Docker images with buildx Woodpecker CI plugin to build multiarch Docker images with buil

Nov 5, 2022
Drone plugin for trigger Jenkins jobs.
Drone plugin for trigger Jenkins jobs.

drone-jenkins Drone plugin for trigger Jenkins jobs. Setup the Jenkins Server Setup the Jenkins server using the docker command: $ docker run \ --na

Sep 27, 2022
Copy files and artifacts via SSH using a binary, docker or Drone CI.

drone-scp Copy files and artifacts via SSH using a binary, docker or Drone CI. Feature Support routines. Support wildcard pattern on source list. Supp

Dec 6, 2022
Drone plugin to skip pipelines based on changed files

drone-skip-pipeline Drone plugin to skip pipelines based on changed files. Build Build the binary with the following command: export GOOS=linux export

Aug 7, 2022
Drone conversion for platform values

drocopla A drone.io conversion extension to set host platform as drone pipeline platform. Default drone.io behaviour: If os/arch is not set in .drone.

Dec 1, 2021
Drone plugin to create comment and label in PR to Gitee
Drone plugin to create comment and label in PR to Gitee

drone-plugin-gitee-pulls 中文文档 Drone plugin to create comment and label in PR to

Sep 6, 2022
Source code and slides for Kubernetes Community Days - Bangalore.
Source code and slides for Kubernetes Community Days - Bangalore.

kcdctl This is the source code for the demo done as part of the talk "Imperative, Declarative and Kubernetes" at the Kubernetes Community Days, Bengal

Sep 19, 2021
The community-supported Golang library for Vonage

Vonage Go SDK This is the community-supported Golang library for Vonage. It has support for most of our APIs, but is still under active development. I

Dec 1, 2021
Kubernetes community content

Kubernetes Community Welcome to the Kubernetes community! This is the starting point for joining and contributing to the Kubernetes community - improv

Jan 4, 2023
fork to roll my own skytap provider

Terraform Provider for Skytap Website: https://www.terraform.io Mailing list: Google Groups Maintainers TBC Requirements Terraform 0.12.x or higher Go

Dec 3, 2021
Ostent is a server tool to collect, display and report system metrics.
Ostent is a server tool to collect, display and report system metrics.

Ostent Ostent collects metrics to display and report to InfluxDB, Graphite, Librato. The interactive display UI (demo): System metrics collected and r

Sep 27, 2022
A serverless cluster computing system for the Go programming language

Bigslice Bigslice is a serverless cluster data processing system for Go. Bigslice exposes composable API that lets the user express data processing ta

Dec 14, 2022
Doraemon is a Prometheus based monitor system
Doraemon is a Prometheus based monitor system

English | 中文 Doraemon Doraemon is a Prometheus based monitor system ,which are made up of three components——the Rule Engine,the Alert Gateway and the

Nov 28, 2022
A tool to build, deploy, and release any environment using System Containers.
A tool to build, deploy, and release any environment using System Containers.

Bravetools Bravetools is an end-to-end System Container management utility. Bravetools makes it easy to configure, build, and deploy reproducible envi

Dec 14, 2022
Sysctl.conf and other system tunings for Linux

PATCHFILES I came to the idea to create patchfiles, when I saw lots of config files people create. Patchfiles implements various config scripts into o

Sep 4, 2022
A set of components that can be composed into a highly available metric system with unlimited storage capacity
A set of components that can be composed into a highly available metric system with unlimited storage capacity

Overview Thanos is a set of components that can be composed into a highly available metric system with unlimited storage capacity, which can be added

Oct 20, 2021
scenario system to check the behavior of kube-scheduler

kube-scheduler-simulator-cli: Kubernetes Scheduler simulator on CLI and scenario system. Hello world. This repository is scenario system for kube-sche

Jan 25, 2022