Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Linux to On-Prem: Task zip empty #190

Closed
iano123 opened this issue Jan 21, 2016 · 8 comments
Closed

Linux to On-Prem: Task zip empty #190

iano123 opened this issue Jan 21, 2016 · 8 comments

Comments

@iano123
Copy link

iano123 commented Jan 21, 2016

Hi,

I have installed vsoagent on RHEL6 with node 4.2.5.

When I start a build then it complains: Could not find task: _work/tasks/Maven/1.0.13/task.json
I looked at the zip file in the same directory and it is empty (size 0).

Is there a way to solve this?
We are offline, the server does not have any connection to internet and the vso agent is connected to tfs 2015

Jan

@bryanmacfarlane
Copy link
Contributor

We were looking at a separate case yesterday with the same issue.

We think it's a name resolution issue. If you could help us confirm, that would be great.

What happens is the server sends an url to the agent for downloading the task (we download as build job demands). That url I think is based on what's in the notification field in the TFS admin console (that field represents what others know the server url to be - reachable by everyone because that's what we will put in emails etc...).

If the agent can't resolve the name in the url (let's say it's http://mytfsserver:8080 but you're addressing via ip or dns/hostname from Linux) then downloading the task fails and you end up with a 0 byte zip file on disk. You can delete _work/tasks and it will download again if the root issue is addressed. I have a bug to make it robust to failures (write to temp dir and rename etc...)

@bryanmacfarlane
Copy link
Contributor

So - the action item is - look at the notification url in the admin console (and maybe the server url). Are those resolvable from your Linux machine? If not, a host file change to confirm the issue and don't forget to delete _work/tasks folder

@bryanmacfarlane bryanmacfarlane changed the title Task zip empty Linux to On-Prem: Task zip empty Jan 21, 2016
@bryanmacfarlane
Copy link
Contributor

We may have found the issue. Can you verify by commenting out part of a function

In agent/taskmanager.js at line 119, you see this function. Comment out the first check block

    TaskManager.prototype.getTaskDefinitionsUri = function () {
        var taskDefinitionsUri = this.executionContext.variables[cm.vars.systemTaskDefinitionsUri];
/*
        if (!taskDefinitionsUri) {
            taskDefinitionsUri = this.executionContext.variables[cm.vars.systemTfCollectionUri];
        }
*/
        if (!taskDefinitionsUri) {
            taskDefinitionsUri = this.executionContext.config.settings.serverUrl;
        }
        return taskDefinitionsUri;
    };

@iano123
Copy link
Author

iano123 commented Jan 22, 2016

I will need to check at work. (un)fortunatly I am off until tuesday.

the issue with the URL could be it. We have a port redirect over an F5. So TFS thinks it is on port 8080 while the agent is connected over port 80 to the F5.
I believe the task should be downloaded from the location of the URL that you need to enter when connecting with the server, not via a property coming from the server. That would eliminate such an issue.

@bryanmacfarlane
Copy link
Contributor

I agree. Should be the host from what you entered and relative path to task sent from server.

I will fix the bug I mentioned above and take a crack at using the host by Tuesday. Will reply when it's in. You'll want to stamp out a new agent. Read instructions because I also wrote docs specifically for on prem this week

@bryanmacfarlane
Copy link
Contributor

I fixed this. Get a new agent. I would recommend installing the preview one (see instructions)

@iano123
Copy link
Author

iano123 commented Feb 1, 2016

Ok it seems to work!

@bryanmacfarlane
Copy link
Contributor

Awesome. Thanks for confirming

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

No branches or pull requests

2 participants