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

Extension v1.0.0 '1Password: Get from 1Password' resulted in an error (Cannot read properties of undefined (reading 'kind')) #28

Open
petercrocker opened this issue Jun 24, 2022 · 12 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@petercrocker
Copy link

Your environment

op-vscode version: v1.0.0
1Password for Mac 8.8.0
VS Code version: Version: 1.68.1 (Universal)
CLI version: 2.5.1
OS: macOS 12.4 (21F79)

Steps to reproduce

  1. Cursor on a given line in VS Code2.
  2. CMD-Shift-P
  3. --> 1Password: Get from 1password
  4. Type name of 1password Login item: "Backblaze" (with first capital, exactly as in 1password
  5. 1password app on macOS gives prompt: "1Password is trying to authorize CLI access to your account “<my_vault_name>” in “Code”
  6. Clicked the "Accept" button
  7. I get the dialog box in VS Code: "Command '1Password: Get from 1Password' resulted in an error (Cannot read properties of undefined (reading 'kind'))"

Note I've completely restarted VS Code and 1password, and 1password helper extension before reproducing this again.

What happened?

Command '1Password: Get from 1Password' resulted in an error (Cannot read properties of undefined (reading 'kind'))

What did you expect to happen?

op:// string should have been pasted in to the line in VS code

Notes & Logs

From ~/Library/Application\ Support/Code/logs/20220624T123025/exthost1/exthost.log

[2022-06-24 12:30:26.676] [exthost] [info] Extension host with pid 73539 started
[2022-06-24 12:30:26.676] [exthost] [info] Skipping acquiring lock for /Users/pete/Library/Application Support/Code/User/workspaceStorage/5664e5b984fa2711b279ab81a4de5fd7.
[2022-06-24 12:30:26.707] [exthost] [info] ExtensionService#_doActivateExtension GrapeCity.gc-excelviewer, startup: false, activationEvent: 'onLanguage:plaintext'
[2022-06-24 12:30:26.711] [exthost] [info] ExtensionService#_doActivateExtension ms-python.python, startup: false, activationEvent: 'onLanguage:ansible', root cause: redhat.ansible
[2022-06-24 12:30:26.754] [exthost] [info] ExtensionService#_doActivateExtension redhat.vscode-yaml, startup: false, activationEvent: 'onLanguage:ansible', root cause: redhat.ansible
[2022-06-24 12:30:26.783] [exthost] [info] ExtensionService#_doActivateExtension vscode.microsoft-authentication, startup: false, activationEvent: 'onAuthenticationRequest:microsoft'
[2022-06-24 12:30:26.799] [exthost] [info] ExtensionService#_doActivateExtension vscode.debug-auto-launch, startup: true, activationEvent: ''
[2022-06-24 12:30:26.802] [exthost] [info] ExtensionService#_doActivateExtension vscode.git-base, startup: true, activationEvent: '
', root cause: vscode.git
[2022-06-24 12:30:26.804] [exthost] [info] ExtensionService#_doActivateExtension vscode.ipynb, startup: true, activationEvent: ''
[2022-06-24 12:30:26.807] [exthost] [info] ExtensionService#_doActivateExtension vscode.github-authentication, startup: true, activationEvent: '
', root cause: GitHub.vscode-pull-request-github
[2022-06-24 12:30:26.816] [exthost] [info] ExtensionService#_doActivateExtension oderwat.indent-rainbow, startup: true, activationEvent: ''
[2022-06-24 12:30:26.836] [exthost] [info] ExtensionService#_doActivateExtension vscode.git, startup: true, activationEvent: '
'
[2022-06-24 12:30:26.850] [exthost] [info] ExtensionService#_doActivateExtension vscode.github, startup: true, activationEvent: ''
[2022-06-24 12:30:26.853] [exthost] [info] ExtensionService#_doActivateExtension GitHub.vscode-pull-request-github, startup: true, activationEvent: '
'
[2022-06-24 12:30:26.958] [exthost] [info] ExtensionService#_doActivateExtension redhat.ansible, startup: false, activationEvent: 'onLanguage:ansible'
[2022-06-24 12:30:26.985] [exthost] [warning] [redhat.vscode-yaml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[yaml]', provide the URI of a resource or 'null' for any resource.
[2022-06-24 12:30:26.985] [exthost] [warning] [redhat.vscode-yaml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[yaml]', provide the URI of a resource or 'null' for any resource.
[2022-06-24 12:30:27.095] [exthost] [warning] [redhat.vscode-yaml] Accessing a resource scoped configuration without providing a resource is not expected. To get the effective value for '[yaml]', provide the URI of a resource or 'null' for any resource.
[2022-06-24 12:30:27.136] [exthost] [info] Eager extensions activated
[2022-06-24 12:30:27.138] [exthost] [info] ExtensionService#_doActivateExtension vscode.emmet, startup: false, activationEvent: 'onStartupFinished'
[2022-06-24 12:30:27.142] [exthost] [info] ExtensionService#_doActivateExtension vscode.merge-conflict, startup: false, activationEvent: 'onStartupFinished'
[2022-06-24 12:30:27.143] [exthost] [info] ExtensionService#_doActivateExtension 1Password.op-vscode, startup: false, activationEvent: 'onStartupFinished'
[2022-06-24 12:30:27.146] [exthost] [info] ExtensionService#_doActivateExtension aaron-bond.better-comments, startup: false, activationEvent: 'onStartupFinished'
[2022-06-24 12:30:27.157] [exthost] [info] ExtensionService#_doActivateExtension eamodio.gitlens, startup: false, activationEvent: 'onStartupFinished'
[2022-06-24 12:30:27.171] [exthost] [info] ExtensionService#_doActivateExtension esbenp.prettier-vscode, startup: false, activationEvent: 'onStartupFinished'
[2022-06-24 12:30:27.191] [exthost] [info] ExtensionService#_doActivateExtension ms-vscode-remote.remote-containers, startup: false, activationEvent: 'onStartupFinished'
[2022-06-24 12:30:27.205] [exthost] [info] ExtensionService#_doActivateExtension PascalReitermann93.vscode-yaml-sort, startup: false, activationEvent: 'onStartupFinished'
[2022-06-24 12:30:27.250] [exthost] [info] ExtensionService#_doActivateExtension PKief.material-icon-theme, startup: false, activationEvent: 'onStartupFinished'
[2022-06-24 12:30:27.255] [exthost] [info] ExtensionService#_doActivateExtension sourcery.sourcery, startup: false, activationEvent: 'onStartupFinished'
[2022-06-24 12:30:27.311] [exthost] [info] ExtensionService#_doActivateExtension vscode.configuration-editing, startup: false, activationEvent: 'onLanguage:jsonc'
[2022-06-24 12:30:27.312] [exthost] [info] ExtensionService#_doActivateExtension vscode.json-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
[2022-06-24 12:30:27.319] [exthost] [info] ExtensionService#_doActivateExtension vscode.typescript-language-features, startup: false, activationEvent: 'onLanguage:jsonc'
[2022-06-24 12:30:55.046] [exthost] [error] TypeError: Cannot read properties of undefined (reading 'kind')
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:206465
at processTicksAndRejections (node:internal/process/task_queues:96:5) op-vscode.getValueFromItem {"value":"1Password.op-vscode","_lower":"1password.op-vscode"}
[2022-06-24 13:33:09.970] [exthost] [warning] TextEditor is closed/disposed
[2022-06-24 13:40:15.948] [exthost] [error] TypeError: Cannot read properties of undefined (reading 'kind')
at /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:206465
at processTicksAndRejections (node:internal/process/task_queues:96:5) op-vscode.getValueFromItem {"value":"1Password.op-vscode","_lower":"1password.op-vscode"}

@petercrocker petercrocker added the bug Something isn't working label Jun 24, 2022
@jodyheavener
Copy link
Member

Hey @petercrocker thanks for the detailed issue (and the kind words 😄)! I'll dig into this a bit to see what it could be. It looks related to #1, which was seemingly resolved by another tweak I made, but maybe it was just a fluke. I'll see what I can find!

@petercrocker
Copy link
Author

Thanks @jodyheavener I saw #1 but seemed to indicate it was fixed in op-vscode v0.1.2 hence submitting this since I'm on the 1.0 later version now. Happy to help debug further, let me know what would be useful.

@1Password 1Password deleted a comment from petercrocker Jun 24, 2022
@jodyheavener
Copy link
Member

@petercrocker Just a heads up, I deleted the screenshot comment because the last field in it was partially unmasked. To be extra safe you might consider rotating that value.

@petercrocker
Copy link
Author

doh! thanks, will do!

@jodyheavener
Copy link
Member

jodyheavener commented Jul 8, 2022

Hey @petercrocker I'm still trying to track down this issue, so I wanted to check to 1) see if this issue continues to persist with this specific item, or all items, 2) are you using 1Password CLI with biometric unlock fully set up? I see you noted that when authorizing you're asked to "Accept", which I believe comes from when you're using the CLI in clamshell mode (We still shouldn't see this issue but wanted to clarify)

@petercrocker
Copy link
Author

Hi @jodyheavener just tested again:

  1. Issue persists with that specific item only. That item has more complexity in it for sure. It's got sections defined, which seems to be the only unique thing about that item. Maybe that could be worth testing?
  2. Yes biometric unlock is fully setup, but as you allude to, i'm using it in clamshell mode when it's on my desktop plugged in to a thunderbolt dock.

That said, I've duplicated the item in question, and I've been removing content. Removed the sections, removed the OTP, yet it's still complaining each time with the error. It's only got a user and pw defined now! Don't know what's unique about that item, but the vs code extension clearly doesn't like it!

If you can tell me where/how to get debugging info, or run vs code extension in debug mode, happy to help!

@jodyheavener
Copy link
Member

Hey @petercrocker, it's been a while, and I haven't been able to narrow down this specific issue, but I wanted to check in to see if you were still able to reproduce it.

If you can tell me where/how to get debugging info, or run vs code extension in debug mode, happy to help!

Currently the extension avoids logging anything like CLI output to prevent accidentally writing sensitive details to disk, so it's sort of a shot in the dark with certain issues, unfortunately.

@petercrocker
Copy link
Author

Hey @jodyheavener thanks for bringing this up again! Ok, so I tried a few things. I think I've narrowed it down, but not sure exactly what it's hanging on. Running op on the items it's barfing on show metadata that I can't see in 1password UI, so can't edit and remove, but seem to be the unique thing about the vault item. I've obfuscated the output a bit:

op item get Item2
ID:          mdwf5tsxxfbobgiftxxzidblah
Title:       Item2
Vault:       MyVault (u6temkdqebd6zccajlzzdkblah)
Created:     3 years ago
Updated:     35 seconds ago by Me
Favorite:    false
Version:     7
Category:    LOGIN
Fields:
  password:             removed!!
  :                     Toggle navigation
  username:             myemail@dev.null
  password:             mypassword
  :                     Sign Up for MySite
  region:               eu-central
  :                     Modal Test
  :                     ×
  :                     Skip Quick
  :                     ×
  :                     Take Me To My Account
  one-time password:    123456
URLs:
  website:    https://somesite.com (primary)

So it's this section I don't see in the UI:

:                     Sign Up for MySite
  region:               eu-central
  :                     Modal Test
  :                     ×
  :                     Skip Quick
  :                     ×
  :                     Take Me To My Account

And if I create a new vault entry from scratch, with just user/pw then of course the metadata isn't in there, and the VScode extension works fine!

As a reminder, this is the error the 1p extension kicks out when trying to reference this:
Command '1Password: Get from 1Password' resulted in an error (Cannot read properties of undefined (reading 'kind'))

Could that help?

@tkelkermans
Copy link

Hi,

I get the same error with :

  • op-vscode version: v1.0.2
  • 1Password for Mac 8.9.7 (80907031)
  • VS Code version: Version: 1.72.2 (Universal)
  • CLI version: 2.7.2
  • OS: macOS 12.6 (21G115)

Did you find how to solve that ?

@maxisam
Copy link

maxisam commented Dec 7, 2022

the format from get from 1password is wrong. It shouldn't include section in output.

image

@jodyheavener
Copy link
Member

Hi @maxisam, thanks for your comment. I think you may be talking about a separate issue, though I can tell you that the extension does construct the secret references; they come directly from the CLI. You might consider opening a post on the CLI forums.

@petercrocker et al, I'm sorry I haven't been able to nail down this issue yet, but it's not been forgotten!

@jodyheavener jodyheavener added the help wanted Extra attention is needed label Dec 9, 2022
@jodyheavener jodyheavener added the hacktoberfest This issue is open to submissions from Hacktoberfest participants label Oct 3, 2023
@jodyheavener
Copy link
Member

This issue is still ongoing and we don't yet have a solution, so I'm going to open this up to Hacktoberfest submissions if anyone is brave enough or has any wild ideas. Good luck!

@jodyheavener jodyheavener removed the hacktoberfest This issue is open to submissions from Hacktoberfest participants label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants