Skip to content
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

BicepNet - Restore Modules broken #336

Open
coolhome opened this issue Jan 17, 2024 · 1 comment
Open

BicepNet - Restore Modules broken #336

coolhome opened this issue Jan 17, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@coolhome
Copy link
Contributor

Describe the bug
Trying to use the bicep public registry in a bicep template produces an error during Build-Bicep

This is working using the latest bicep cli to restore.

Build-BicepNetFile: main.bicep(9,34) : Error BCP192: Unable to restore the module with reference "br:mcr.microsoft.com/bicep/avm/res/resources/resource-group:0.2.1":
Unhandled exception: System.ArgumentNullException: Value cannot be null. (Parameter 'stream')    at System.BinaryData.FromStreamAsync(Stream stream, CancellationToken cancellationToken)    at
Azure.Containers.ContainerRegistry.ContainerRegistryContentClient.DownloadBlobContentInternalAsync(String digest, Boolean async, CancellationToken cancellationToken)    at
Azure.Containers.ContainerRegistry.ContainerRegistryContentClient.DownloadBlobContentAsync(String digest, CancellationToken cancellationToken)    at Bicep.Core.Registry.AzureContainerRegistryManager.PullLayerAsync(ContainerRegistryContentClient    
client, OciDescriptor layer, CancellationToken cancellationToken) in /home/runner/work/BicepNet/BicepNet/output/RequiredModules/Bicep/Bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 193    at
Bicep.Core.Registry.AzureContainerRegistryManager.<>c__DisplayClass8_0.<<DownloadManifestAndLayersAsync>b__0>d.MoveNext() in
/home/runner/work/BicepNet/BicepNet/output/RequiredModules/Bicep/Bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 177 --- End of stack trace from previous location ---    at
Bicep.Core.Registry.AzureContainerRegistryManager.DownloadManifestAndLayersAsync(IOciArtifactReference artifactReference, ContainerRegistryContentClient client) in
/home/runner/work/BicepNet/BicepNet/output/RequiredModules/Bicep/Bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 178    at
Bicep.Core.Registry.AzureContainerRegistryManager.<>c__DisplayClass4_0.<<PullArtifactAsync>g__DownloadManifestInternalAsync|0>d.MoveNext() in
/home/runner/work/BicepNet/BicepNet/output/RequiredModules/Bicep/Bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 53 --- End of stack trace from previous location ---    at
Bicep.Core.Registry.AzureContainerRegistryManager.PullArtifactAsync(RootConfiguration configuration, IOciArtifactReference artifactReference) in
/home/runner/work/BicepNet/BicepNet/output/RequiredModules/Bicep/Bicep/src/Bicep.Core/Registry/AzureContainerRegistryManager.cs:line 60    at Bicep.Core.Registry.OciArtifactRegistry.TryRestoreArtifactAsync(RootConfiguration configuration,
OciArtifactReference reference) in /home/runner/work/BicepNet/BicepNet/output/RequiredModules/Bicep/Bicep/src/Bicep.Core/Registry/OciArtifactRegistry.cs:line 449

To Reproduce
Steps to reproduce the behavior:

  1. Ensure%UserProfile%/.bicep/br/* is empty
  2. Use any bicep module from a registry
  3. Build-Bicep main.bicep

Expected behavior
Ability to restore modules from PSBicep

Additional context
None

@coolhome coolhome added the bug Something isn't working label Jan 17, 2024
@PalmEmanuel
Copy link
Member

PalmEmanuel commented Jan 19, 2024

Thanks for the bug report! I suspect this might be connected to #318, since the underlying repository has some differences. We'll have a look as soon as possible!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants