-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
Unable to specify the backend engine using the CLI argument '--backend-engine' #3195
Comments
@qwerty287 Yes, certainly. Thanks for your efforts. Please give me a few days, but I should be able to send you a feedback hopefully this week. |
@qwerty287 Your branch has already been merged into 2.6.0, right? I quickly made the update from 2.5.0 to 2.6.0 and removed the When starting
If I add the environment variable again, the
|
Yes.
Did you start with the CLI argument? If you don't use "standard" docker (e.g. podman) it is necessary to set an env var or the CLI argument. It only worked with |
Yes, I believe so. This is the command I am running.
The moment I export the environment variable:
|
Is it possible for you to compile/run a custom binary so we can some debugging prints? |
Yes, certainly. It is a busy week for me, but I can try to build/run a custom release. Is there a branch I can try? |
Not yet, I'll try some things later this week but it's also busy for me ;) |
@liv-io Here you go: https://github.com/qwerty287/woodpecker/tree/debug-print I only changed 3 lines. |
@qwerty287 Thanks a lot! This is the output I get.
Let me know if I need to provide additional details. Thanks for your help. |
Did you use the CLI flag in both cases? If not, can you try this? |
It seems to work without the
Also when adding the environment variable (again without the
|
I mean the This one is the problem. In your case, the engine is selected correctly, but it then fails because the docker backend says it's not available. It should work however. Can you check the branch again? I added some more prints |
I don't quite understand. Sorry for confusing things. Since I am not using Docker, but Podman I thought specifying the I ran a version of your latest branch/commit. These are the results:
|
The problem is: The backend is correctly selected, but the docker backend says it is not available. If you set a custom host, it should actually work however… The only reason I can currently imagine is that there is some problem with the boolean flags. Can you try running the agent without all options that are not required? E.g. The only case that's interesting here is without env var, but with flag. |
Huh, it seems like your intuition was right. Thanks a lot for your help by the way! I simply removed the
It selects the Do you want me to test more variations of my command? |
Can you try |
Seems to work 👍
Am I supposed to use the equal sign for all |
You can do, that makes it more clear. I can open an issue in the parser library to find out why this doesn't work if you think that's helpful |
The woodpecker-agent
Would you update the output or leave as is?
Do you think both options (with and without equal sign) should work? If yes, maybe we it is worth creating a ticket. Which parser library is being used? |
I need to check that too first, but I think it should work.
|
It seems adding an equal sign to all "long options" (with double dash) does not work. I can provide additional details if this is valuable. Thanks for finding the library! |
Hey @liv-io, can you try to reproduce this with the latest version? Because we switched to v3 of the cli library, so it would be good to know whether it works there. |
@qwerty287 I've added an equal sign to all long options and it seems to work. Thanks a lot for your help. I will close this ticket. Cheers. PS. Tested with version 2.7.1 |
Component
agent
Describe the bug
When running
woodpacker-agent
without a configuration file but only command-line arguments, the backend engine cannot be defined. Somehow the argument--backend-engine
does not work and it falls back to local.The following command does not select the
docker
backend:While the agent starts, it immediately prints the following message to the logs (
backend 'local'
):When I export the environment variable
DOCKER_HOST
and run the same command again, the correct backend is selected:The log output is (
backend 'docker'
):System Info
Output of
https://<your-woodpecker-instance>/version
:Additional info on my setup:
Containerfile:
https://github.com/liv-io/oci-containers/blob/main/woodpecker-agent/Containerfile
Entrypoint/CMD script:
https://github.com/liv-io/oci-containers/blob/main/woodpecker-agent/cmd.sh
Additional context
No response
Validations
next
version already [https://woodpecker-ci.org/faq#which-version-of-woodpecker-should-i-use]The text was updated successfully, but these errors were encountered: