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

WSL: Kiota.Builder.KiotaBuilder[0]: error generating the client: Access to the path is denied. #3213

Closed
daveneeley opened this issue Aug 28, 2023 · 6 comments
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@daveneeley
Copy link

Hello. I'm excited to try this project out, but I've not been able to get it running in WSL Ubuntu 22.04.

I've installed kiota through asdf, and also downloaded it directly from the site. I've also tried v 1.4.0 and v1.5.1. If I try to kiota show a remote spec, I receive a 404 not found error. If I download the spec to a local file, kiota show returns Access to the path is denied. It doesn't work with sudo either.

I'm not sure to what to do with it at this point. Is this a WSL thing or a kiota thing?

> ./kiota --version

1.5.1+fa29e2d2bffade1fa69c06bf42719bb7c48910b5

> ./kiota show --openapi https://raw.githubusercontent.com/PagerDuty/api-schema/main/reference/REST/openapiv3.json

crit: Kiota.Builder.KiotaBuilder[0]
      error showing the description: Response status code does not indicate success: 404 (Not Found).

> curl -O https://raw.githubusercontent.com/PagerDuty/api-schema/main/reference/REST/openapiv3.json

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1639k  100 1639k    0     0  4871k      0 --:--:-- --:--:-- --:--:-- 4880k

> ls

Kiota.Builder.pdb  appsettings.json  client  kiota  kiota.pdb  linux-x64.zip  openapiv3.json

> ./kiota show -d ./openapiv3.json

crit: Kiota.Builder.KiotaBuilder[0]
      error showing the description: Access to the path '/srv/pd-browser/' is denied.
      
> ls -la ..

drwxr-xr-x  3 me me 4096 Aug 28 16:12 pd-browser

> ls -la

total 105284
drwxr-xr-x 3 me me     4096 Aug 28 16:12 .
drwxr-xr-x 3 root    root        4096 Aug 28 15:58 ..
-rw-r--r-- 1 me me       12 Aug 28 16:10 .tool-versions
-rw-r--r-- 1 me me   355260 Aug  9 06:47 Kiota.Builder.pdb
-rw-r--r-- 1 me me     7435 Aug  9 06:46 appsettings.json
drwxr-xr-x 2 me me     4096 Aug 28 16:05 client
-rwxr-xr-x 1 me me 73556063 Aug  9 06:47 kiota
-rw-r--r-- 1 me me    92812 Aug  9 06:47 kiota.pdb
-rwxr-xr-x 1 me me 32095822 Aug 28 16:05 linux-x64.zip
-rw-r--r-- 1 me me  1679248 Aug 28 16:12 openapiv3.json
@daveneeley
Copy link
Author

Oh, thinking it might be a mount point thing, I intentionally tried a path under /srv after trying all of the same steps under ~/.

@daveneeley
Copy link
Author

Interestingly, on powershell core on windows, the error message is slightly different for the local file case. Note the last character is missing from the filename in the error message.

> ./kiota show --openapi .\openapiv3.json

crit: Kiota.Builder.KiotaBuilder[0]
      error showing the description: Could not find file 'C:\Users\me\repos\oss-tools\pd-browser\openapiv3.jso'.

Attempting to download a URI for the spec also fails in powershell core on windows.

./kiota show --openapi https://raw.githubusercontent.com/PagerDuty/api-schema/main/reference/REST/openapiv3.json
crit: Kiota.Builder.KiotaBuilder[0]
      error showing the description: Response status code does not indicate success: 404 (Not Found).

@daveneeley
Copy link
Author

With debug logging, it's clear that the file is present and the content accurate.

dbug: Kiota.Builder.KiotaBuilder[0]
      kiota version 1.5.1
dbug: Kiota.Builder.KiotaBuilder[0]
      cache file /tmp/kiota/cache/generation/C48C50A461A061E66A4C3D4B56CD27915DF56B90C8800A185A1A007FD13EF1E3/openapiv3.json is up to date and clearCache is False, using it
trce: Kiota.Builder.KiotaBuilder[0]
      11ms: Read OpenAPI file https://raw.githubusercontent.com/PagerDuty/api-schema/main/reference/REST/openapiv3.json
dbug: Kiota.Builder.KiotaBuilder[0]
      step 1 - reading the stream - took 00:00:00.0139527
trce: Kiota.Builder.KiotaBuilder[0]
      Parsing OpenAPI file
crit: Kiota.Builder.KiotaBuilder[0]
      error showing the description: Response status code does not indicate success: 404 (Not Found).

@baywet baywet self-assigned this Aug 29, 2023
@baywet baywet added the duplicate This issue or pull request already exists label Aug 29, 2023
@baywet
Copy link
Member

baywet commented Aug 29, 2023

Hi @daveneeley
Thanks for your interest in kiota and for reaching out.
This is a duplicate of #2363 a number of references in that description are not supported by the parsing library we use (openapi.net)
Closing to centralize the discussion

@daveneeley
Copy link
Author

daveneeley commented Aug 29, 2023

Thanks for following up. The error messages that are shown here have no obvious connection to #2363. In order to get a somewhat useful error message (without asking for help) I had to compile from source and change settings.LoadExternalRefs = false; on src/Kiota.Builder/KiotaBuilder.cs#486. In the debugger I observed the circular reference as noted in PagerDuty/api-schema#392.

@baywet
Copy link
Member

baywet commented Aug 29, 2023

yes there are improvements required in that space. We're mostly waiting on proper external references support in OpenAPI.net to make any further investment in that space at this point. Which may lead to confusing situations like the one you've experienced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants