-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
CacheBeta task: "The path provided is invalid" for Maven repository #11259
Comments
I am having the same problem: |
Same issue here. Tried also to set the variables on job level rather than pipeline, but did not help. Further I tried |
Exactly the same here. Build Windows first - restores cache and updates it post-job. Then builds Mac but crashes post-job. To confound things further, each step uses a |
Yml extract:
Working Windows console output:
Non-working Mac console output:
|
I'm having the exact same issue, but following the My config looks like this steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: CacheBeta@0
inputs:
key: yarn | $(Agent.OS) | yarn.lock
path: $(Pipeline.Workspace)/.yarn
displayName: Cache Yarn packages
- bash: yarn audit
displayName: 'Check for vulnerabilities'
- bash: yarn ci
displayName: 'Install dependencies' |
An update on this: When I run the build with
I notice that |
In my case the issue could be solved. I was wrongly assuming that
After this, the documented configuration works. |
Same issue when following NuGet docs. Worked fine with a solution having one project. Added a new project to the solution and then it started to fail with the error
|
I have the the same issue this feature simple doesn't work ... It's also quite difficult understand which folder the task is checking ...
|
@fadnavistanmay sorry for pinging you directly. It seems that quite a few different users are affected by this. Can you take a look? |
I have also seen that the cache doesn't keep the correct mode of the file so some file that are executable lost their mod ... |
Thanks for reporting @rmetzger - I'll take a look at this today. |
Hi @rmetzger / others. - I have set up a basic yaml e.gs for some tools. - https://github.com/fadnavistanmay/azure-pipelines-caching-yaml/blob/master/templates/java-with-maven.yml Could you please check and let us know if that helps. Plus, you can see the build definition using - https://github.com/fadnavistanmay/azure-pipelines-caching-yaml .
|
@fadnavistanmay The key you are generating: https://github.com/fadnavistanmay/azure-pipelines-caching-yaml/blob/master/templates/asp.net-core.yml#L15 is unique for each build, right? And does not take the hash of the How will that work? Will that not defeat the purpose of a cache since the key is not "the same" across builds sharing the same dependencies? |
Hi @danielwertheim - that's correct. That key is just for my testing purpose, Actually I have different jobs running, so it will be a cache hit in the next job, in the same build. We are heads down in updating the docs/ and the sample yaml repo,(setting up builds to accept PRs, etc) - and it should be done by early next week. I'll circle back to this thread after that, and we can continue the discussion then :) Thanks. |
@fadnavistanmay: Using a |
Is it normal that cache restores are full of exceptions? https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_apis/build/builds/1535/logs/26 |
@rmetzger - I took a quick look at the yaml, I suspect the container might be behaving weirdly in terms of host/container path mapping. But, $(Pipeline.Workspace) is mapped to container, can you please give a quick try without it and see if it works. "Is it normal that cache restores are full of exceptions?" -> Those exceptions are harmless and coming from Azure Storage. But that doesn't explain the 4 min it took at restore cache. Could you point us to the build which took 4 mins. |
I have tried various things, all without real success. It seems that the files are not restored into the specified folder. Abbreviated config: variables:
MAVEN_CACHE_FOLDER: /home/user/.m2/repository
...
jobs:
- job: runOnDefaultAgentPool
steps:
- script: ls -lisah /home/user/.m2/repository
- task: CacheBeta@1
inputs:
key: $(CACHE_KEY)
restoreKeys: $(CACHE_FALLBACK_KEY)
path: $(MAVEN_CACHE_FOLDER)
cacheHitVar: CACHE_RESTORED
displayName: Cache Maven local repo
- script: ls -lisah $(MAVEN_CACHE_FOLDER) I would expect the files to be in Full file: https://github.com/rmetzger/flink/blob/1029f71132c4b92e9575aa1c2421d3027ca1ece9/azure-pipelines.yml In this build, the download takes more than 4 minutes: https://dev.azure.com/rmetzger/Flink/_build/results?buildId=1519&view=logs&j=96e03a1a-0ac4-5903-83b1-91e6a9dce517 In general, I believe there's a way of making the caching functionality work. It is probably a matter of my custom docker container, my own build servers and me not having enough time to fully look into the issue. |
@gpad That is rolling out per #10925 @danielwertheim and @ifiokjr - could you file separate issues for problems you are seeing with yarn/npm/dotnet/nuget? I don't want those to be lost in this Maven discussion. |
Hi @rmetzger - We have a new task out, MavenAuthenticate@0. The design philosophy behind this task is that we will authenticate all the repositories you describe in the task, and get out of the way leaving you fully in control of running your You mentioned above that running the You also mentioned that you use the Maven@3 command only to get test reporting, can you elaborate on that? There are other test reporting tasks that you can use to achieve the same results, you can ping me and I can help you set those up as well. |
Thanks for your comments. @aasim: After I commented here, I had the same thought and I found the |
It looks like
We should clarify in the exception |
@fadnavistanmay Yes, I was able to resolve the issue. |
Thanks @rmetzger . |
(from #11259 (comment)) This behavior is now at least documented: MicrosoftDocs/azure-devops-docs#8142 (though I would prefer to have the Maven task respect the global variable) |
Required Information
Question, Bug, or Feature?
Type: Question
Enter Task Name: CacheBeta@0
I'm trying to use the cache in a Maven project.
These are the relevant parts of the
azure-pipelines.yml
file:I'm getting the following unexpected error:
This is a build with that error: https://dev.azure.com/rmetzger/Flink/_build/results?buildId=86&view=logs&j=a6fe42f4-2b81-59e8-5c7c-1a0db487583c
This is the full
azure-pipelines.yml
file from that build: https://github.com/rmetzger/flink/blob/3d201d6abd020adad68e3bc842b4c4b7e0d3d260/azure-pipelines.ymlI have put the
path
directly, instead of using the variable as suggested in the documentation to rule out any issues with the variable system.The text was updated successfully, but these errors were encountered: