Closed dR3b closed 10 months ago
Every restart is resulting in a new agent when using the system token. There was a PR merged which saves the agent-id to a file. Please try next version for the agent as well
Ok now I use the next
image on the agent too. But every container restart its always creating a "new" agent:
[0]# sqlite3 /srv/docker/woodpecker/app/data/woodpecker.sqlite
SQLite version 3.34.1 2021-01-20 14:10:07
Enter ".help" for usage hints.
sqlite>
sqlite> select * from agents limit 20;
29943|1695192746|1695192866||-1|yYT|1695192866|linux/amd64|docker|4|next-6d86ec7fe7|0
29944|1695192872|1695192872||-1|yYT|1695192872|linux/amd64|docker|4|next-6d86ec7fe7|0
[0]# docker-compose up -d --force-recreate
Recreating woodpecker-agent ... done
Recreating woodpecker-app ... done
[0]# sqlite3 /srv/docker/woodpecker/app/data/woodpecker.sqlite
SQLite version 3.34.1 2021-01-20 14:10:07
Enter ".help" for usage hints.
sqlite> select * from agents limit 20;
29943|1695192746|1695192866||-1|yYT|1695192866|linux/amd64|docker|4|next-6d86ec7fe7|0
29944|1695192872|1695193032||-1|yYT|1695193032|linux/amd64|docker|4|next-6d86ec7fe7|0
29945|1695193037|1695193037||-1|yYT|1695193037|linux/amd64|docker|4|next-6d86ec7fe7|0
If you want the agent to remember its id, you need to give it a persistent volume. Like here https://woodpecker-ci.org/docs/administration/agent-config
# docker-compose.yml
version: '3'
services:
woodpecker-agent:
[...]
volumes:
- woodpecker-agent-config:/etc/woodpecker
@runephilosof-karnovgroup Thanks! I found the solution too.
Component
agent
Describe the bug
sqlite> select * from agents;
:System Info