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

Can not install extensions via commandline #141

Closed
jhandel opened this issue Aug 19, 2016 · 21 comments
Closed

Can not install extensions via commandline #141

jhandel opened this issue Aug 19, 2016 · 21 comments

Comments

@jhandel
Copy link

jhandel commented Aug 19, 2016

This command used to work with VSTS with no problems...

tfx extension install --token [My Persona Access Token] --service-url https://marketplace.visualstudio.com/ --publisher [My Publishing Account] --extension-id [My Extention] --accounts [target account]

(values removed to protect the innocent)

I hadn't used it for a few weeks, but now all I receive is the following error :
[target account]: [Failed: Error: Failed Request: Forbidden(403) - Access Denied: [user name] needs the following permission(s) to perform this action: Edit instance-level information]

Nothing was changed in our account in VSTS nor was anything changed in the release that uses this code.. I have also tried this manually with the same error..

I have looked into VSTS online and can't find anywhere to set or confirm if Edit instance-level information has been edited... Also I can still install extensions via the marketplace (even the extension I had previously automated the installation of).

Thanks

@T-Hugs
Copy link
Contributor

T-Hugs commented Aug 19, 2016

Is it possible your token has expired?

@jhandel
Copy link
Author

jhandel commented Aug 19, 2016

Nope that is a brand new token (thought of that, revoked and created a new token) and the token successfully publishes extensions with no changes to those steps...

@T-Hugs
Copy link
Contributor

T-Hugs commented Aug 19, 2016

Interesting. I was able to repro this. Someone must have changed something important without telling me :) I'll have a look next week. Sorry for the inconvenience!

@jhandel
Copy link
Author

jhandel commented Aug 19, 2016

Thanks for looking into it so quickly.. Have a great weekend.. hopefully it won't be too nasty a fix for the team.

@jdshkolnik
Copy link

Whew; it's not just me.

@brunopssp
Copy link

The exactly same thing with me.

@T-Hugs
Copy link
Contributor

T-Hugs commented Aug 24, 2016

Just a quick update - we briefly looked into this issue and so far don't know what the cause is. I wasn't able to reproduce it on my local dev instance, only against production. Our team is quite busy this week with RC2, so we probably won't be able to really investigate until next week. Sorry for the delays! You should still be able to use Install through the web UI.

@T-Hugs
Copy link
Contributor

T-Hugs commented Sep 6, 2016

I have the fix for this - I'm wrapping things up now but I have to leave early today - I will try to push this evening.

@T-Hugs
Copy link
Contributor

T-Hugs commented Sep 7, 2016

Ok, hopefully this is fixed in e38bbdb. Let me know if you run into any issues. Thanks.

@T-Hugs T-Hugs closed this as completed Sep 7, 2016
@jmezach
Copy link

jmezach commented Sep 7, 2016

Not sure if this is related to this fix, but I tried to run my release definition today which shares an existing extension with another account and then tries to install it, but now I'm getting the following error:

2016-09-07T07:31:16.4879327Z [command]C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.104.1\tasks\ShareExtension\0.7.3\node_modules\.bin\tfx.cmd extension share --token ******** --service-url https://marketplace.visualstudio.com/ --publisher jonathan-mezach --extension-id new-relic-dashboard-widgets-private --share-with spicer-testtarget

2016-09-07T07:31:16.5939322Z C:\LR\mms\Services\mms\TaskAgentProvisioner\Tools\agents\1.104.1\tasks\ShareExtension\0.7.3\node_modules\tfx-cli\_build\lib\qfs.js:39

2016-09-07T07:31:16.5959313Z function fileAccess(path, mode = exports.F_OK) {

2016-09-07T07:31:16.5969310Z                                ^

2016-09-07T07:31:16.5969310Z SyntaxError: Unexpected token =

2016-09-07T07:31:16.5969310Z     at exports.runInThisContext (vm.js:53:16)

2016-09-07T07:31:16.5979323Z     at Module._compile (module.js:387:25)

2016-09-07T07:31:16.5989316Z     at Object.Module._extensions..js (module.js:422:10)

2016-09-07T07:31:16.5999330Z     at Module.load (module.js:357:32)

2016-09-07T07:31:16.5999330Z     at Function.Module._load (module.js:314:12)

2016-09-07T07:31:16.5999330Z     at Module.require (module.js:367:17)

2016-09-07T07:31:16.6009334Z     at require (internal/module.js:20:19)

2016-09-07T07:31:16.6009334Z     at Object.<anonymous> (C:\LR\mms\Services\mms\TaskAgentProvisioner\Tools\agents\1.104.1\tasks\ShareExtension\0.7.3\node_modules\tfx-cli\_build\lib\command.js:3:12)

2016-09-07T07:31:16.6009334Z     at Module._compile (module.js:413:34)

2016-09-07T07:31:16.6029314Z     at Object.Module._extensions..js (module.js:422:10)

Any ideas if this is related? It worked yesterday by the way.

@T-Hugs
Copy link
Contributor

T-Hugs commented Sep 7, 2016

Interesting, I'm not quite sure what that is at the moment. I will look into it when I get a chance. For now can you revert to the previous version?

@jmezach
Copy link

jmezach commented Sep 7, 2016

Unfortunately I can't do that since I'm using the Build and Release tasks for Extensions. They simply download the latest version of the TFS CLI onto the build agent and I don't currently have a dedicated agent available.

@T-Hugs
Copy link
Contributor

T-Hugs commented Sep 7, 2016

Ok. For now I will republish the former version and add a beta tag to the new one. Sorry for the confusion.

@T-Hugs
Copy link
Contributor

T-Hugs commented Sep 7, 2016

So, I think this was related to switching to ES6 output, which could have caused issues on older versions of nodejs. I switched back to ES5. Would you mind trying again?

@bryanmacfarlane
Copy link
Contributor

node should be packaged with tfx like we did with old node agent ...

@jmezach
Copy link

jmezach commented Sep 7, 2016

Well, the good news is that sharing the extension with another account works again now. Unfortunately installing the extension into an account still fails, although with a different error message than originally reported:

2016-09-07T11:40:09.7905624Z [command]C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.104.1\tasks\InstallExtension\0.7.3\node_modules\.bin\tfx.cmd extension install --token ******** --service-url https://marketplace.visualstudio.com/ --publisher jonathan-mezach --extension-id new-relic-dashboard-widgets-private --accounts spicer-testtarget

2016-09-07T11:40:10.7235623Z TFS Cross Platform Command Line Interface v0.3.30

2016-09-07T11:40:10.7245614Z Copyright Microsoft Corporation

2016-09-07T11:40:15.1498123Z Error: Failed Request: Unauthorized(401) - 

@T-Hugs
Copy link
Contributor

T-Hugs commented Sep 7, 2016

Ok, thanks for the info. I will have to look into this more when I get back in the office on Friday. Installation worked fine for me when I tested with my account, so I'm not sure why you're getting a 401. I will forward this thread to someone else on my team in case they are able to take a look while I'm out.

@T-Hugs T-Hugs reopened this Sep 7, 2016
@jmezach
Copy link

jmezach commented Sep 14, 2016

Any updates on this?

@T-Hugs
Copy link
Contributor

T-Hugs commented Sep 14, 2016

Hey Jonathan, I've had a number of people try with the new version of TFX and so far everyone is able to install extensions again. Can you double-check your personal access token? For now, create one that has permissions for "All accessible accounts" and "All scopes". If that works, you should be able to reduce the set of scopes to these:
image

@jmezach
Copy link

jmezach commented Sep 14, 2016

Ah, it looks like it works again now. I probably didn't have the right scopes checked. Is there any up-to-date documentation on which ones you actually need? It looks like these have changed recently.

@T-Hugs
Copy link
Contributor

T-Hugs commented Sep 14, 2016

Good news! I'll make sure the documentation gets updated. Thanks.

@T-Hugs T-Hugs closed this as completed Sep 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants