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

A 404 "Not Found" error occurs when trying to get the agent queues using TFS 2015 Update 4 on-premise #371

Closed
icnocop opened this issue Jan 30, 2020 · 7 comments
Labels

Comments

@icnocop
Copy link
Contributor

icnocop commented Jan 30, 2020

Environment

Node version: 10.15.1
Npm version: 6.4.1
OS and version: Windows Server 2019 Version 1809 OS Build 17763.107
azure-devops-node-api version: 10.0.0

Issue Description

A 404 "Not Found" error occurs when trying to get the agent queues using TFS 2015 Update 4 on-premise.

Expected behaviour

I expected the URL to be queried:
http://tfs2015:8080/tfs/DefaultCollection/_apis/distributedtask/queues/

Actual behaviour

The URL is queried:
http://tfs2015:8080/tfs/DefaultCollection/Project Name/_apis/distributedtask/queues/

Steps to reproduce

  1. Call getAgentQueues("Project Name") against TFS 2015 Update 4 on-premise.
  2. Notice a 404 "Not Found" error

Logs

I will try to reproduce this issue in isolation if needed, but it may take a bit.

@stephenmichaelf
Copy link
Member

This is due to using the latest version of the lib with an older version of TFS. Please see our main page here for a mapping of what version of the lib to use based on what version of TFS you have.

@icnocop
Copy link
Contributor Author

icnocop commented Jan 30, 2020

Thank you.

I guess I'm confused by which "later versions" in "All API versions will work on the server version mentioned as well as later versions." from readme.md.

Does "later versions" mean "later TFS versions"?

@icnocop
Copy link
Contributor Author

icnocop commented Feb 1, 2020

As a work-around, I was able to use IIS URL Rewrite with this rule, added to the Team Foundation Server/tfs virtual directory (C:\Program Files\Microsoft Team Foundation Server 14.0\Application Tier\Web Services\web.config):

<rewrite>
    <rules>
        <rule name="Rewrite distributedtask/queues" stopProcessing="true">
            <match url="(.*)/(.*)/_apis/distributedtask/queues" />
            <conditions>
                <add input="{URL}" pattern="DefaultCollection/_apis/distributedtask/queues" negate="true" />
            </conditions>
            <action type="Rewrite" url="{R:1}/_apis/distributedtask/queues" logRewrittenUrl="true" />
        </rule>
    </rules>
</rewrite>

It basically rewrites API requests from
http://tfs2015:8080/tfs/DefaultCollection/MyProject/_apis/distributedtask/queues
to
http://tfs2015:8080/tfs/DefaultCollection/_apis/distributedtask/queues

Thank you.

@stephenmichaelf
Copy link
Member

@icnocop We will clean up that text, I agree it's confusing.

I still am confused by your request: why would you need a new version of the lib to use against 2015 on-prem?

Also, I would not recommend doing the IIS rewrite.

@icnocop
Copy link
Contributor Author

icnocop commented Feb 4, 2020

why would you need a new version of the lib to use against 2015 on-prem?

I'm using https://github.com/huserben/TfsExtensions which depends on v6.6.3.

In order to use it against TFS 2015 on-prem, I had to implement the IIS URL Rewrite work-around.

Should v6.6.3 be compatible with TFS 2015 on-prem?
If not, how else would you suggest making it work, besides updating TFS?

Thank you.

@stephenmichaelf
Copy link
Member

Should v6.6.3 be compatible with TFS 2015 on-prem?

You'll have to talk with the Extension owner about this, which will also answer your last question.

@stephenmichaelf
Copy link
Member

Closing, as mentioned please speak with the Extension owner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants