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

Unexpected token P in JSON at position 0 azure developer CLI extension vscode #2072

Closed
amit-pazcare opened this issue May 2, 2023 · 7 comments
Assignees
Labels
customer-reported identify a customer issue question vscode Visual Studio Code

Comments

@amit-pazcare
Copy link

Does this occur consistently?
Repro steps:

Action: azure-dev.views.workspace.environment.resolve
Error type: 1
Error Message: Process 'azd env list --cwd "/Users/redacted:username/Deskto...' exited with code 1
Error: {"type":"consoleMessage","timestamp":"redacted:id02T23redacted:id+redacted:id","data":{"messhttps://docs.github.com/en/early-access/issues/about-tasklistsage":"listing environments: listing entries: open /Users/redacted:username/Desktop/msdocs-flask-postgresql-sample-app/.azure: no such file or directory\n"}}

Version: 0.4.2
OS: darwin
OS Release: 22.1.0
Product: Visual Studio Code
Product Version: 1.76.0
Language: en

Call Stack
ChildProcess.<anonymous> extension.js:2:919933
@ghost ghost added needs-triage For new issues customer-reported identify a customer issue question labels May 2, 2023
@savannahostrowski savannahostrowski added the vscode Visual Studio Code label May 2, 2023
@ghost ghost removed the needs-triage For new issues label May 2, 2023
@ellismg
Copy link
Member

ellismg commented May 2, 2023

So, clearly bad of the CLI to give back a string instead of JSON in this error case, but from the error message, it sounds like the .azure folder didn't exist, which seems like an issue in itself?

@bwateratmsft
Copy link
Contributor

bwateratmsft commented May 4, 2023

Very similar to #2011 which @weikanglim fixed. Maybe exactly the same.

@rajeshkamal5050
Copy link

@weikanglim does your fix above handle this error scenario? so VSCode gets a proper error json?

@weikanglim
Copy link
Contributor

@rajeshkamal5050 The underlying "listing environments" implementation was fixed, so it's no longer an issue if the user doesn't have an .azure folder, but the output isn't fixed

@weikanglim
Copy link
Contributor

@bwateratmsft Based on the info above, is there something we need to do in the CLI? I can't tell if the output is the raw output that VSCode got from the CLI.

From the error message "Unexpected token P at position 0", could the token be referring to the "Process" in
Error Message: Process 'azd env list --cwd "/Users/redacted:username/Deskto...' exited with code 1?

@bwateratmsft
Copy link
Contributor

That's my suspicion, yes. But if it no longer errors on a missing .azure then I'm not sure there's anything more to do?

@rajeshkamal5050
Copy link

rajeshkamal5050 commented Jun 15, 2023

Marking this as fixed as part of #2296

acme@devdiv azd-demo % azd env list --output json
[]

acme@devdiv azd-demo % azd show --output json
{
  "name": "todo-python-mongo",
  "services": {
    "api": {
      "project": {
        "path": "/Users/acme/azd-demo/src/api",
        "language": "python"
      }
    },
    "web": {
      "project": {
        "path": "/Users/acme/azd-demo/src/web",
        "language": "node"
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported identify a customer issue question vscode Visual Studio Code
Projects
None yet
Development

No branches or pull requests

7 participants