microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.5k stars 2.61k forks source link

CacheV2 task fails with: "API resource location ... is not registered on ..." #13937

Closed abeggchr closed 1 year ago

abeggchr commented 3 years ago

Question, Bug, or Feature?
Type: Question

Enter Task Name: CacheV2

Environment

Issue Description

The CacheV2 task fails with the following error: "API resource location ... is not registered on ..."

  1. The first question is: Is this task even supported on on-premise "Azure DevOps Server"? One documentation says yes (Azure DevOps Server 2020 is listed below the title), the other documentation is clearly for Azure DevOps Services only and does not appear when Azure DevOps Server 2020 is selected.

  2. Second question: how to get rid of the "API resource location ... is not registered on ..." error?

Task logs

2020-11-20T07:39:50.2443422Z ##[debug]Evaluating condition for step: 'cache npm install' 2020-11-20T07:39:50.2445465Z ##[debug]Evaluating: SucceededNode() 2020-11-20T07:39:50.2445988Z ##[debug]Evaluating SucceededNode: 2020-11-20T07:39:50.2447024Z ##[debug]=> True 2020-11-20T07:39:50.2447508Z ##[debug]Result: True 2020-11-20T07:39:50.2448050Z ##[section]Starting: cache npm install 2020-11-20T07:39:50.3262696Z ============================================================================== 2020-11-20T07:39:50.3263184Z Task : Cache 2020-11-20T07:39:50.3263380Z Description : Cache files between runs 2020-11-20T07:39:50.3263575Z Version : 2.0.1 2020-11-20T07:39:50.3263761Z Author : Microsoft Corporation 2020-11-20T07:39:50.3263991Z Help : https://aka.ms/pipeline-caching-docs 2020-11-20T07:39:50.3264274Z ============================================================================== 2020-11-20T07:39:50.7343271Z Resolving key: 2020-11-20T07:39:51.1031779Z - npm install [string] 2020-11-20T07:39:51.9715331Z - /./Sources/Tra/Mistra.Tra.Web.React/package-l... [file pattern; matches: 1] 2020-11-20T07:39:51.9715952Z - s\Sources\Tra\Mistra.Tra.Web.React\package-lock.json --> 25FB5553554AFBD8626565C687511D6AE2E956176AF4FB84ECD440525CC46221 2020-11-20T07:39:52.5960314Z - /./Sources/Tra/Mistra.Tra.Web.React/package-l... [file pattern; matches: 1] 2020-11-20T07:39:52.5961111Z - s\Sources\Tra\Mistra.Tra.Web.React\package-lock.json --> 25FB5553554AFBD8626565C687511D6AE2E956176AF4FB84ECD440525CC46221 2020-11-20T07:39:53.1679120Z - **/./Sources/Tra/Mistra.Tra.Web.React/kendo-ui-... [file pattern; matches: 1] 2020-11-20T07:39:53.1679980Z - s\Sources\Tra\Mistra.Tra.Web.React\kendo-ui-license.txt --> 63967BE06005DCD18CE75C7A10ADB0BEFC99E9BFC74D0A50B27E7007A4B3552A 2020-11-20T07:39:53.1766401Z Resolved to: npm install|EurlvEGXBdkIVJfmTxiIRaan9cXiCt1aIMvY2hvqfGA=|EurlvEGXBdkIVJfmTxiIRaan9cXiCt1aIMvY2hvqfGA=|X1RkN2nwbIW+kY/F/Sza84d7/eIjAxlrEr6Xj+UuJa8= 2020-11-20T07:39:53.1768293Z ##[debug]Processed: ##vso[task.settaskvariable variable=RESTORE_STEP_RAN;issecret=False;]true 2020-11-20T07:39:53.1856797Z ##[debug]Processed: ##vso[task.settaskvariable variable=RESTORE_STEP_RESOLVED_FINGERPRINT;issecret=False;]npm install|EurlvEGXBdkIVJfmTxiIRaan9cXiCt1aIMvY2hvqfGA=|EurlvEGXBdkIVJfmTxiIRaan9cXiCt1aIMvY2hvqfGA=|X1RkN2nwbIW+kY/F/Sza84d7/eIjAxlrEr6Xj+UuJa8= 2020-11-20T07:39:53.4869875Z ##[debug]Dedup parallelism: 192 2020-11-20T07:39:53.6664408Z Information, Getting a pipeline cache artifact with the following fingerprint: npm install|EurlvEGXBdkIVJfmTxiIRaan9cXiCt1aIMvY2hvqfGA=|EurlvEGXBdkIVJfmTxiIRaan9cXiCt1aIMvY2hvqfGA=|X1RkN2nwbIW+kY/F/Sza84d7/eIjAxlrEr6Xj+UuJa8=. 2020-11-20T07:39:53.7402148Z ##[error]API resource location a7c78d38-31a8-417e-ba6b-7e58b352f304 is not registered on https:///tfs//. 2020-11-20T07:39:53.7412129Z ##[debug]Processed: ##vso[task.logissue type=error;]API resource location a7c78d38-31a8-417e-ba6b-7e58b352f304 is not registered on https:///tfs//. 2020-11-20T07:39:53.7420023Z ##[debug]Processed: ##vso[task.complete result=Failed;] 2020-11-20T07:39:53.7424173Z ##[debug] at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.CreateRequestMessageAsync(HttpMethod method, IEnumerable1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable1 queryParameters, Object userState, CancellationToken cancellationToken, String mediaType) at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.SendAsync[T](HttpMethod method, IEnumerable1 additionalHeaders, Guid locationId, Object routeValues, ApiResourceVersion version, HttpContent content, IEnumerable1 queryParameters, Object userState, CancellationToken cancellationToken) at Microsoft.VisualStudio.Services.PipelineCache.WebApi.PipelineCacheClient.GetPipelineCacheArtifactAsync(Fingerprint[] fingerprints, CancellationToken cancellationToken) at Microsoft.VisualStudio.Services.PipelineCache.WebApi.PipelineCacheClient.<>c__DisplayClass9_0.<b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Services.BlobStore.Common.Telemetry.BlobStoreClientTelemetry.MeasureActionAsync[TResult](BlobStoreTelemetryRecord record, Func1 actionAsync) at Microsoft.VisualStudio.Services.Content.Common.ExceptionExtensions.ReThrow(Exception ex) at Microsoft.VisualStudio.Services.BlobStore.Common.Telemetry.BlobStoreClientTelemetry.MeasureActionAsync[TResult](BlobStoreTelemetryRecord record, Func1 actionAsync) at Microsoft.VisualStudio.Services.PipelineCache.WebApi.PipelineCacheClient.GetPipelineCacheArtifactAsync(Fingerprint[] fingerprints, CancellationToken cancellationToken, PipelineCacheTelemetryRecord cacheRecordOptional) at Agent.Plugins.PipelineCache.PipelineCacheServer.DownloadAsync(AgentTaskPluginExecutionContext context, Fingerprint[] fingerprints, String path, String cacheHitVariable, CancellationToken cancellationToken) at Agent.Plugins.PipelineCache.RestorePipelineCacheV0.ProcessCommandInternalAsync(AgentTaskPluginExecutionContext context, Fingerprint fingerprint, Func`1 restoreKeysGenerator, String path, CancellationToken token) at Agent.Plugins.PipelineCache.PipelineCacheTaskPluginBase.RunAsync(AgentTaskPluginExecutionContext context, CancellationToken token) at Agent.PluginHost.Program.Main(String[] args) 2020-11-20T07:39:53.7543577Z ##[section]Finishing: cache npm install

johnterickson commented 3 years ago

It is not supported on-premises. @fadnavistanmay can you update the incorrect docs?

abeggchr commented 3 years ago

@johnterickson thanks for the clarification!

mdailey77 commented 3 years ago

The documentation still hasn't been updated: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/cache?view=azure-devops. Still says the Cache task is available in DevOps Server 2020. Why is my organization paying for a DevOps Server license when some of the promised features don't actually work? Talk about misleading.

lle-beep commented 3 years ago

On june 2021, still present in documentation and the same issue still happening on Dev18.M170.6 on-premise version. 😞

prashantp747 commented 3 years ago

I am getting the same issue for Azure DevOps Server 2020. When it can be expected to resolve?

holtalanm commented 3 years ago

Documentation still wrong apparently. Yay for wasting people's time due to misleading docs!

Why is this issue closed??

seanblonien commented 3 years ago

@johnterickson Why is this issue closed? It still is not supported.

johnterickson commented 3 years ago

@carl-tanner Can you make sure the docs get updated?

rklec commented 2 years ago

It's 2022 by now and your doc is still misleading or should I say just factually wrong...

grafik

Does it maybe help to report this issue with your feedback feature there? grafik

Because that page clearly does not help... after all...


Does anyone have any workaround on how to still make this feature work? E.g. by using V1 of this cache task or so? Or would this be a bad idea? (If so, why?)

rklec commented 2 years ago

Okay got the same errors with CacheBeta@0 and CacheBeta@1, so well...

rklec commented 2 years ago

A custom caching with Powershell and copying should work: https://github.com/microsoft/azure-pipelines-artifact-caching-tasks/issues/41#issuecomment-863395122

bitbonk commented 2 years ago

Any chance that this cache task will also be supported in Azure DevOps Server soon? Or is there an alternative to hand rolling a custom solution like the above script? We stumbled across the same problem.

carl-tanner commented 2 years ago

I'm updating the documentation so that it says it is limited to Azure DevOps services. Pipeline cache is built upon the same infrastructure that pipeline artifacts uses and is not available in the server product.

elvince commented 2 years ago

and is not available in the server produc

Does the V0 works on premise? How to make the task works on premise? You add it to OnPremise server, so I hope it should work at some extend.

Thanks,

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

bitbonk commented 2 years ago

This issue is still valid. There must be some sort of caching for on-premise DevOps too.

freakalot commented 1 year ago

I don't understand why this should not work for OnPremise installation except of a business strategy forcing users into the managed service. But for complex environments this is not an option at all because of 3rd party dependencies. Caching must be provided for OnPremise installations as well.

holtalanm commented 1 year ago

@freakalot don't know what your use-case is, but I was able to work around this in my use-case by using a separate on-prem hosted service to cache my 3rd-party dependencies. specifically in my case, it was dependencies from an npm ci call. I used Verdaccio to cache my dependencies on the local network, which helped with build time considerably.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days