stride3d / stride3d/stride

Stride appears to assume that no nuget package source will be authenticated and falls over when encountering one.

Open
#2,152 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

This is not a priority issue as there is a workaround, just submitting the bug report to help anyone else that encounters this issue and to record its existence. This is also a decent candidate for a fix for any new contributors.

Release Type: Official Release

Version: 4.2.0.2067

Platform(s): Windows

Describe the bug
When attempting to create a new project from a template (actually some other operations appear to also fail in this way), if any nuget repository specified in the global config (typically found at: %appdata%\NuGet\NuGet.Config) is not publicly accessible the template will fail half way through and bail leaving the newly created project in an incomplete state.

To Reproduce
Steps to reproduce the behavior:

  1. Add a nuget repository that is password protected to the global nuget config (%appdata%\NuGet\NuGet.Config on windows)
  2. Attempt to create a new template

Expected behavior
Exception handling and ignoring any invalid/authenticated package sources specified in global config.

Log
Verbose: Process dependencies for JumpyJet.Game...
Info: Upgrading project [JumpyJet.Game] to use [Stride.Core] from version [4.1.0.1-beta] to [4.2.0.2067] will be required
Verbose: Restore NuGet packages for JumpyJet.Game...
[C:\Program Files\dotnet\sdk\8.0.100\NuGet.targets(156,5)]: Error: Unable to load the service index for source [URL-TO-PRIVATE-WORK-NUGET-REMOVED].
Response status code does not indicate success: 401 (Unauthorized).
[C:\Program Files\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(266,5)]: Error: Assets file 'F:\GameDev\sandbox\JumpyJet\JumpyJet.Game\obj\project.assets.json' not found. Run a NuGet package restore to generate this file.
[C:\Program Files\dotnet\sdk\8.0.100\NuGet.targets(156,5)]: Error: Unable to build assembly reference [F:\GameDev\sandbox\JumpyJet\JumpyJet.Game\bin\Debug\net8.0\JumpyJet.Game.dll]
[C:\Program Files\dotnet\sdk\8.0.100\NuGet.targets(156,5)]: Verbose: Loading Assets from Package [JumpyJet.Game.sdpkg]
Warning: Could not deserialize object of type 'JumpyJet.UIScript'; replacing it with an object implementing IUnloadable
YamlException: Unable to resolve tag [!JumpyJet.UIScript,JumpyJet.Game] to type from tag resolution or registered assemblies ((Lin: 24, Col: 54, Chr: 1016) -> (Lin: 25, Col: 24, Chr: 1074))
at Stride.Core.Yaml.Serialization.Serializers.TagTypeSerializer.ReadYaml(ObjectContext& objectContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Yaml\Serialization\Serializers\TagTypeSerializer.cs:line 81
at Stride.Core.Yaml.ErrorRecoverySerializer.ReadYaml(ObjectContext& objectContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\Yaml\ErrorRecoverySerializer.cs:line 50

Warning: Could not deserialize object of type 'JumpyJet.CharacterScript'; replacing it with an object implementing IUnloadable
YamlException: Unable to resolve tag [!JumpyJet.CharacterScript,JumpyJet.Game] to type from tag resolution or registered assemblies ((Lin: 23, Col: 54, Chr: 1099) -> (Lin: 24, Col: 24, Chr: 1164))
at Stride.Core.Yaml.Serialization.Serializers.TagTypeSerializer.ReadYaml(ObjectContext& objectContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Yaml\Serialization\Serializers\TagTypeSerializer.cs:line 81
at Stride.Core.Yaml.ErrorRecoverySerializer.ReadYaml(ObjectContext& objectContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\Yaml\ErrorRecoverySerializer.cs:line 50

Warning: Could not deserialize object of type 'JumpyJet.BackgroundScript'; replacing it with an object implementing IUnloadable
YamlException: Unable to resolve tag [!JumpyJet.BackgroundScript,JumpyJet.Game] to type from tag resolution or registered assemblies ((Lin: 62, Col: 54, Chr: 3133) -> (Lin: 63, Col: 24, Chr: 3199))
at Stride.Core.Yaml.Serialization.Serializers.TagTypeSerializer.ReadYaml(ObjectContext& objectContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Yaml\Serialization\Serializers\TagTypeSerializer.cs:line 81
at Stride.Core.Yaml.ErrorRecoverySerializer.ReadYaml(ObjectContext& objectContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\Yaml\ErrorRecoverySerializer.cs:line 50

Warning: Could not deserialize object of type 'JumpyJet.PipesScript'; replacing it with an object implementing IUnloadable
YamlException: Unable to resolve tag [!JumpyJet.PipesScript,JumpyJet.Game] to type from tag resolution or registered assemblies ((Lin: 87, Col: 54, Chr: 4503) -> (Lin: 88, Col: 24, Chr: 4564))
at Stride.Core.Yaml.Serialization.Serializers.TagTypeSerializer.ReadYaml(ObjectContext& objectContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Yaml\Serialization\Serializers\TagTypeSerializer.cs:line 81
at Stride.Core.Yaml.ErrorRecoverySerializer.ReadYaml(ObjectContext& objectContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\Yaml\ErrorRecoverySerializer.cs:line 50

Warning: Could not deserialize object of type 'JumpyJet.CharacterScript'; replacing it with an object implementing IUnloadable
YamlException: Unable to resolve tag [!JumpyJet.CharacterScript,JumpyJet.Game] to type from tag resolution or registered assemblies ((Lin: 105, Col: 54, Chr: 5593) -> (Lin: 106, Col: 24, Chr: 5658))
at Stride.Core.Yaml.Serialization.Serializers.TagTypeSerializer.ReadYaml(ObjectContext& objectContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Yaml\Serialization\Serializers\TagTypeSerializer.cs:line 81
at Stride.Core.Yaml.ErrorRecoverySerializer.ReadYaml(ObjectContext& objectContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\Yaml\ErrorRecoverySerializer.cs:line 50

Warning: Could not deserialize object of type 'JumpyJet.JumpyJetRenderer'; replacing it with an object implementing IUnloadable
YamlException: Unable to resolve tag [!JumpyJet.JumpyJetRenderer,JumpyJet.Game] to type from tag resolution or registered assemblies ((Lin: 103, Col: 12, Chr: 6262) -> (Lin: 104, Col: 8, Chr: 6312))
at Stride.Core.Yaml.Serialization.Serializers.TagTypeSerializer.ReadYaml(ObjectContext& objectContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\core\Stride.Core.Yaml\Serialization\Serializers\TagTypeSerializer.cs:line 81
at Stride.Core.Yaml.ErrorRecoverySerializer.ReadYaml(ObjectContext& objectContext) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets\Yaml\ErrorRecoverySerializer.cs:line 50

[C:\Program Files\dotnet\sdk\8.0.100\NuGet.targets(156,5)]: Error: An exception occurred while generating the template.
InvalidOperationException: Unable to find the base [DefaultGraphicsCompositorLevel9] of asset [GraphicsCompositor].
at Stride.Core.Assets.Quantum.AssetPropertyGraph.RefreshBase() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\assets\Stride.Core.Assets.Quantum\AssetPropertyGraph.cs:line 194
at Stride.Core.Assets.Editor.Components.TemplateDescriptions.SessionTemplateGenerator.ApplyMetadata(SessionTemplateGeneratorParameters parameters) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\editor\Stride.Core.Assets.Editor\Components\TemplateDescriptions\SessionTemplateGenerator.cs:line 93
at Stride.Assets.Presentation.Templates.TemplateSampleGenerator.Generate(SessionTemplateGeneratorParameters parameters) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\editor\Stride.Assets.Presentation\Templates\TemplateSampleGenerator.cs:line 258
at Stride.Core.Assets.Editor.Components.TemplateDescriptions.SessionTemplateGenerator.Run(SessionTemplateGeneratorParameters parameters) in C:\BuildAgent\work\b5f46e3c4829a09e\sources\editor\Stride.Core.Assets.Editor\Components\TemplateDescriptions\SessionTemplateGenerator.cs:line 41
at Stride.Core.Assets.Editor.Components.TemplateDescriptions.TemplateGeneratorHelper.<>c__DisplayClass0_0`1.b__0() in C:\BuildAgent\work\b5f46e3c4829a09e\sources\editor\Stride.Core.Assets.Editor\Components\TemplateDescriptions\TemplateGeneratorHelper.cs:line 56

Workaround
Disable/comment out authenticated package sources from the global nuget config when working on stride.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the template-generation entry points named in the log: Stride.Core.Assets.Editor/Components/TemplateDescriptions/SessionTemplateGenerator.cs and TemplateGeneratorHelper.cs, then reproduce the failure with an authenticated source in the global NuGet.Config. Trace how package-restore errors reach template generation and verify that an inaccessible source no longer leaves the generated project incomplete.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system, game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.