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

generating the msgraph beta go sdk randomly errors out #1744

Closed
jaym opened this issue Jul 15, 2022 · 7 comments
Closed

generating the msgraph beta go sdk randomly errors out #1744

jaym opened this issue Jul 15, 2022 · 7 comments
Assignees

Comments

@jaym
Copy link

jaym commented Jul 15, 2022

I ran kiota on a linux machine:

hidi transform -d https://raw.githubusercontent.com/microsoftgraph/msgraph-metadata/master/openapi/beta/openapi.yaml -c msgraph.json -o output.yaml
kiota -l go -d output.yaml -c GraphServiceClient -n msgraphbetasdkgo  -o client --ll Trace

where msgraph.json is from https://gist.github.com/jaym/6cbb56b2405274bd169d76b2d4afb3f0

Sometimes, if the process doesn't get killed for using too much memory, I get an error message:

crit: Kiota.Builder.KiotaBuilder[0]
      error generating the SDK: the current dom node already contains a child with name settings and of type CodeProperty
@ghost ghost added the Needs: Triage 🔍 label Jul 15, 2022
@baywet baywet self-assigned this Jul 15, 2022
@baywet
Copy link
Member

baywet commented Jul 15, 2022

Hi @jaym,
Thanks for reaching out and for trying Kiota and Hidi.
I've tried to reproduce the issue you're describing without success.
Can you provide more details about:

  • versions of Kiota and hidi in use (--version)
  • are you running them from containers
  • OS
  • anything else you think could be useful

@baywet
Copy link
Member

baywet commented Jul 15, 2022

Note: while investigating this issue we have to keep in mind the following inaccuracies are present in the description
microsoft/OpenAPI.NET#834
microsoft/OpenAPI.NET.OData#240
microsoft/OpenAPI.NET.OData#248

@jaym
Copy link
Author

jaym commented Jul 15, 2022

I'm on archlinux. Not running in a container.

$ hidi --version
1.0.0-preview8+b2f53ee6aa7a34266b03b1d152ba72a740454177
$ kiota --version
0.3.0-preview+c70e794366fda239983bbbf1a2a0ba321853ff90

Here's some information from the dotnet tool:

$ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.102
 Commit:    49861cb924

Runtime Environment:
 OS Name:     arch
 OS Version:  
 OS Platform: Linux
 RID:         arch-x64
 Base Path:   /usr/share/dotnet/sdk/6.0.102/

Host (useful for support):
  Version: 6.0.2
  Commit:  839cdfb0ec

.NET SDKs installed:
  5.0.101 [/usr/share/dotnet/sdk]
  6.0.102 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 5.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 5.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download

It's not clear to me this is related to the memory issue as this dies right away. I figured out how to reliably reproduce it:
if i give it a directory for -o that doesn't exist, it seems to always happen. The directory is then created, and retrying fixes the problem

@baywet
Copy link
Member

baywet commented Jul 15, 2022

Thanks for the additional information. Are you inferring that pointing to a non-existent directory is what's making it die?

@jaym
Copy link
Author

jaym commented Jul 15, 2022

correct. so passing -o nonexstingdir causes that error to happen. The program does end up creating that directory before it exits with the error though, so rerunning doesn't produce the error

@andrueastman
Copy link
Member

Hey @jaym,

I believe we have some unreleased fixes(#1734) that should most likely fix this error. This error was previously caused by an update to the openApi metadata that Kiota did not fully support.

crit: Kiota.Builder.KiotaBuilder[0]
      error generating the SDK: the current dom node already contains a child with name settings and of type CodeProperty

Any chance you can try pulling the main branch of this repo and confirm if the error is replicated on your end when generating the SDK?

@jaym
Copy link
Author

jaym commented Jul 18, 2022

thanks, both the memory issue and the random failure are not reproducible on main

@jaym jaym closed this as completed Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants