-
Notifications
You must be signed in to change notification settings - Fork 431
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
Publish to Azure DevOps Wiki fails with Error: spawn git ENOENT #738
Comments
Sounds like you have tried everything I can think of. But, interestingly I had a similar issue myself yesterday
We tried everything we could think of, with no luck finding a real solution. In the end, and it was a work around, what we did was to add a separate agent stage to the pipeline stage to do the release generation and wiki upload and got this to be run by a hosted agent. Would this work for you? But this is a workaround but not a solution. This task uses Simple-Git to do the upload, the task just wrappers this. The only way I can think of to move this forward is to do some local testing of Simple-Git a failing agent. Unfortunately, I don't have access to such an agent. |
Oh, sorry forgot to say there is one thing extra to try switch on the inject header option to true. This can help if proxies are in the way. It was added to fix an issue for on premises TFS setups, but it is worth a try |
Look like there is a work around the Git, at least if content should be published to AzureDevops Wiki I can push new page to Wiki using PS and DevOps API but that is exactly what I wanted to avoid by using WIKIUpdater task. I will keep on trying to find solution for the original problem |
I have tried Inject Header option but it failed with the same error message |
I think I have found the cause of the problem Environment PATH variable had After Adding 'C:\Program Files\Git' to the path and restarting agent service deployment was successful. I am not 100% sure yet. Let me check it on another environment as well before closing this issue |
I was wrong. The correct solution is to add It seems that simple-git is sending git commands to console and console cannot resolve path to git.exe because it is not in the environment path. |
Thanks for the excellent analysis. I will add it to the wiki notes in a troubleshooting section |
New troubleshooting notes in WIKI with 1.12.3 |
We have the exact same problem here. Git is missing in the enviroment path variable. Can someone tell me, how I can add the Git-Path to the agent path variable? |
I assume you are using the hosted agents, as if it is private agent you can just update the path in the standard manner via the control panel for all users. If it is hosted agent, then you need to make the change at runtime. The path is only an environmental variable, so you could try the process outlined here |
No, we are using private agents. I assume we are talking about the System capabilities of the agent, right? |
You can use the Windows UI to edit the path for all users
You can set the path here for all users on that machine |
So I was completely wrong :D Works like a charm now. Thank you. |
In case it helps anyone, I had this in a pipeline when using an Ubuntu VM, and the easiest fix was to switch to windows-latest, because that latter has the path to GIT already set up. |
Maybe I'm not commenting in the right issue, but I'm also facing the same problem, but under an Ubuntu Hosted Agent. Any plan to make this task work on Linux? I know using the image windows-latest is the workaround, but we're trying to exclusively use linux machines inside our build agents to reduce the overall execution time. |
@ddprince-yaksa you have a new issue it is best to start a new discussion or issue with details of your problem. This thread was about the WIKI Updater, this already support Windows, Linux and Max agents - but this that the task you are using? |
@rfennell yes this is the task we're using. I'm having the issue described here under an Ubuntu agent. I can open a new issue if you want! |
So your problem is that the task cannot fine the instance of the Git command line tool? I assume this is on an on premise Ubuntu agent, as I have tested this task with the Microsoft hosted Ubuntu agents. If that is the case, the fix is the same a Windows, make sure Git is installed on the agent and it is in the path If that does not sort it, might be best to log a new issues with a details debug log (run with the variable |
@rfennell this is not an on premise agent, we're using the Microsoft Hosted Agent. I'm currently getting the details and I can get back to you. Which information from the debug output would you like to see? |
The whole debug output for the task, the following is what I expect to see for a Ubuntu agent
|
@ddprince-yaksa this is getting too complex to handle in a side chat - now being tracked in #1473 |
Release notes are successful generated but in the next step publish to Azure DevOps Wiki fails with following error:
tasklog_18.log
YAML Definition
I am getting the same outcome no matter I am using username and PAT, OAUTH token, or if credentials are passed via Header.
Agent Info
I have successfully tested the same task group using both azure-hosted and self-hosted agents with out any problems using OAUTH token. All release notes were successful published to the same git repo.
Once tests were all good I have added the same taskgroup to stages for our production environments.
Self-hosted agents on both test and production environments are configured to run under local admin account as windows service.
PAT issued for agents have full access to Azure DevOps.
Other info
The text was updated successfully, but these errors were encountered: