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

Error: open : The system cannot find the file specified. #1281

Closed
SzabKel opened this issue Oct 14, 2022 · 6 comments · Fixed by #1286
Closed

Error: open : The system cannot find the file specified. #1281

SzabKel opened this issue Oct 14, 2022 · 6 comments · Fixed by #1286
Labels

Comments

@SzabKel
Copy link

SzabKel commented Oct 14, 2022

Describe the Issue:
Following the guide here, I downloaded doctl.exe, put it on the path. Running doctl auth init does not work however (tried it with powershell, CMD, with and without administrator rights).

It asks for the access token, then throws an error:
image

Error: open : The system cannot find the file specified.

Environment:

  • doctl version: doctl-1.83.0-windows-amd64
  • OS: Windows 10 21H2
  • Installation method: manually downloaded the exe

Additional Details:

The %APPDATA%\doctl\config.yaml file exists and if I try to auth init with a --name it will also save the access token to the config file. However running auth switch --context <name> throws the save error. Running doctl account get does not work.

Manually specifying the config path does not work as well (the file exists however):
image

@SzabKel SzabKel added the bug label Oct 14, 2022
@andrewsomething
Copy link
Member

andrewsomething commented Oct 14, 2022

Hi @SzabKel,

Thanks for flagging this for us. I haven't been able to reproduce the problem yet myself.

%APPDATA% is a variable that should be expanded. What does $env:APPDATA output for you? Are you able to write to that directory? You should be able to check permission on the file itself with something like:

​(Get-ACL -Path "\path\to\config.yaml").Access | Format-Table IdentityReference,FileSystemRights,AccessControlType,IsInherited,InheritanceFlags -AutoSize

What does doctl --help output as the default for the --config flag?

@emersonp
Copy link

emersonp commented Oct 15, 2022

Running into the same error as OP.

My $env:APPDATA outputs C:\Users\parke\AppData\Roaming\, and within I can find a doctl\config.yaml.

The (Get-ACL... command throws an error (maybe I'm bad at PowerShell?)
(Get-ACL -Path "C:\Users\parke\AppData\Roaming\doctl\config.yaml").Access | Format-Table IdentityReference,FileSystemRights,AccessControlType,IsInherited,InheritanceFlags -AutoSize

: The term '​' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ ​(Get-ACL -Path "C:\Users\parke\AppData\Roaming\doctl\config.yaml").A ...
+ ~
    + CategoryInfo          : ObjectNotFound: (​:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Doubling the backslashes doesn't help.

What does doctl --help output as the default for the --config flag?

Specify a custom config file (default "C:\\Users\\parke\\AppData\\Roaming\\doctl\\config.yaml")

Environment:
doctl version: doctl-1.83.0-windows-amd64
OS: Windows Version 10.0.22000 Build 22000
Installation method: Via powershell instructions in Guide above.

@SzabKel
Copy link
Author

SzabKel commented Oct 17, 2022

@andrewsomething

%APPDATA% is a variable that should be expanded. What does $env:APPDATA output for you? Are you able to write to that directory?
image

I can write to that directory yes.

image

You should be able to check permission on the file itself with something like:

image

What does doctl --help output as the default for the --config flag?

image

@SzabKel
Copy link
Author

SzabKel commented Oct 18, 2022

Manually passing in the config with the full path seems to work.
image

doctl account get works after this.

@andrewsomething
Copy link
Member

I believe we have tracked down the root of this problem. It should be fixed in the v1.84.0 release via #1286. Unfortunately, the issue was with the config file itself. So if you have been experiencing this problem, you will need to either delete your existing config file or edit it to remove the stanza that looks like:

config:
  set:
    dev-config: ""

Please let us know if this has resolved the issue for you.

@SzabKel
Copy link
Author

SzabKel commented Oct 19, 2022

@andrewsomething I can confirm, the new version fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants