Issue with nodejs deployment
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 881
- Forks
- 195
- Avg merge
- 20h 13m
- Merged PRs (30d)
- 13
Description
Bug Report
-
At what date and time did you most recently experience the problem?
27-Mar-2024, 20:23IST -
Where did you experience the problem? E.g. Azure Web Apps, Azure Functions, Azure Container Registry, or offline use.
Azure Web Apps -
If your repo is publicly available please share its URL:
not available -
What happened?
gives error: of some internal json library, -
What did you expect or want to happen?
successfull build and deploy of node js project -
How can we reproduce it?
i can share you source code privately for debugging purpose. -
Do you have log output? Please include between the backticks:
Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20 -p virtualenv_name= --log-file /tmp/build-debug.log -i /tmp/8dc4e6d6f5de13d -p compress_node_modules=tar-gz | tee /tmp/oryx-build.log
Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
You can report issues at https://github.com/Microsoft/Oryx/issues
Oryx Version: 0.2.20230829.1, Commit: 5bd3088141516cdbd815d62ada052654e91f0429, ReleaseTagName: 20230829.1
Build Operation ID: 645007868151dcee
Repository Commit : c68bd677-b738-4643-8855-9fe3868f9fdd
OS Type : bookworm
Image Type : githubactions
Detecting platforms...
Error: Oops... An unexpected error has occurred.
Error: Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path '', line 1, position 1.
at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)
at Newtonsoft.Json.Linq.JObject.Parse(String json)
at Microsoft.Oryx.Detector.ParserHelper.ParseJsonFile(ISourceRepo sourceRepo, String filePath) in /usr/oryx/src/Detector/ParserHelper.cs:line 86
at Microsoft.Oryx.Detector.Hugo.HugoDetector.IsHugoJsonFile(ISourceRepo sourceRepo, String[] subPaths) in /usr/oryx/src/Detector/Hugo/HugoDetector.cs:line 229
at Microsoft.Oryx.Detector.Hugo.HugoDetector.IsHugoApp(ISourceRepo sourceRepo, String& appDirectory) in /usr/oryx/src/Detector/Hugo/HugoDetector.cs:line 157
at Microsoft.Oryx.Detector.Hugo.HugoDetector.Detect(DetectorContext context) in /usr/oryx/src/Detector/Hugo/HugoDetector.cs:line 49
at Microsoft.Oryx.BuildScriptGenerator.Hugo.HugoPlatform.Detect(RepositoryContext context) in /usr/oryx/src/BuildScriptGenerator/Hugo/HugoPlatform.cs:line 61
at Microsoft.Oryx.BuildScriptGenerator.DefaultPlatformsInformationProvider.GetPlatformsInfo(RepositoryContext context) in /usr/oryx/src/BuildScriptGenerator/DefaultPlatformsInformationProvider.cs:line 53
at Microsoft.Oryx.BuildScriptGenerator.DefaultBuildScriptGenerator.GenerateBashScript(BuildScriptGeneratorContext context, String& script, List`1 checkerMessageSink) in /usr/oryx/src/BuildScriptGenerator/DefaultBuildScriptGenerator.cs:line 75
at Microsoft.Oryx.BuildScriptGeneratorCli.BuildScriptGenerator.TryGenerateScript(String& generatedScript, Exception& exception) in /usr/oryx/src/BuildScriptGeneratorCli/BuildScriptGenerator.cs:line 63
at Microsoft.Oryx.BuildScriptGeneratorCli.BuildCommand.Execute(IServiceProvider serviceProvider, IConsole console) in /usr/oryx/src/BuildScriptGeneratorCli/Commands/BuildCommand.cs:line 278
at Microsoft.Oryx.BuildScriptGeneratorCli.CommandBase.OnExecute(IConsole console) in /usr/oryx/src/BuildScriptGeneratorCli/Commands/CommandBase.cs:line 87
Error: Oops... An unexpected error has occurred.\nError: Newtonsoft.Json.JsonReaderException: Error reading JObject from JsonReader. Current JsonReader item is not an object: StartArray. Path '', line 1, position 1.\n at Newtonsoft.Json.Linq.JObject.Load(JsonReader reader, JsonLoadSettings settings)\n at Newtonsoft.Json.Linq.JObject.Parse(String json, JsonLoadSettings settings)\n at Newtonsoft.Json.Linq.JObject.Parse(String json)\n at Microsoft.Oryx.Detector.ParserHelper.ParseJsonFile(ISourceRepo sourceRepo, String filePath) in /usr/oryx/src/Detector/ParserHelper.cs:line 86\n at Microsoft.Oryx.Detector.Hugo.HugoDetector.IsHugoJsonFile(ISourceRepo sourceRepo, String[] subPaths) in /usr/oryx/src/Detector/Hugo/HugoDetector.cs:line 229\n at Microsoft.Oryx.Detector.Hugo.HugoDetector.IsHugoApp(ISourceRepo sourceRepo, String& appDirectory) in /usr/oryx/src/Detector/Hugo/HugoDetector.cs:line 157\n at Microsoft.Oryx.Detector.Hugo.HugoDetector.Detect(DetectorContext context) in /usr/oryx/src/Detector/Hugo/HugoDetector.cs:line 49\n at Microsoft.Oryx.BuildScriptGenerator.Hugo.HugoPlatform.Detect(RepositoryContext context) in /usr/oryx/src/BuildScriptGenerator/Hugo/HugoPlatform.cs:line 61\n at Microsoft.Oryx.BuildScriptGenerator.DefaultPlatformsInformationProvider.GetPlatformsInfo(RepositoryContext context) in /usr/oryx/src/BuildScriptGenerator/DefaultPlatformsInformationProvider.cs:line 53\n at Microsoft.Oryx.BuildScriptGenerator.DefaultBuildScriptGenerator.GenerateBashScript(BuildScriptGeneratorContext context, String& script, List`1 checkerMessageSink) in /usr/oryx/src/BuildScriptGenerator/DefaultBuildScriptGenerator.cs:line 75\n at Microsoft.Oryx.BuildScriptGeneratorCli.BuildScriptGenerator.TryGenerateScript(String& generatedScript, Exception& exception) in /usr/oryx/src/BuildScriptGeneratorCli/BuildScriptGenerator.cs:line 63\n at Microsoft.Oryx.BuildScriptGeneratorCli.BuildCommand.Execute(IServiceProvider serviceProvider, IConsole console) in /usr/oryx/src/BuildScriptGeneratorCli/Commands/BuildCommand.cs:line 278\n at Microsoft.Oryx.BuildScriptGeneratorCli.CommandBase.OnExecute(IConsole console) in /usr/oryx/src/BuildScriptGeneratorCli/Commands/CommandBase.cs:line 87\n/bin/bash -c "oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 20 -p virtualenv_name= --log-file /tmp/build-debug.log -i /tmp/8dc4e6d6f5de13d -p compress_node_modules=tar-gz | tee /tmp/oryx-build.log ; exit $PIPESTATUS "
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported Oryx build command and trace the stack from BuildScriptGenerator.DefaultPlatformsInformationProvider through HugoDetector.cs and ParserHelper.cs, especially ParserHelper.cs line 86. Compare the detector's JSON input with the reported StartArray error; done means the Node.js build can complete without this detection failure, with a regression test if an existing detector test location is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, nodejs
- Domain
- build-system, cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100