microsoft / vso-agent

Visual Studio Team Services and TFS agent for Mac OSX and Linux
MIT License
131 stars 57 forks source link

Cannot read property 'mappings' of null #218

Closed igorguga closed 8 years ago

igorguga commented 8 years ago

I installed the xplat agent on a Oracle Linux machine. The machine did't have internet access, so folow the instruction of https://github.com/Microsoft/vso-agent/blob/master/docs/onprem.md#agents-without-internet-access. But the machine I used to download the agent was CentOS 7.

The agent started with no problem, but when I start a build, I got some errors like this on the shell: /bin/sh: -c: line0: unexpected EOF while looking for matching ...

And the build log fails with this error, after the workspace was created: ##[Error] 2016-02-15T15:39:16.645Z: Cannot read property 'mappings' of null

If I repeat the build, I got the error: _An error occurred: The workspace ws_217;TFSBuild already exists on computer jbpaqmssr001 So I delete the workspace with the command tf workspace -delete and queue the build again, and it fails again the error: ##[Error] 2016-02-15T15:39:16.645Z: Cannot read property 'mappings' of null.

What can be happening?

yacaovsnc commented 8 years ago

Did you install the preview agent or the regular agent? Can you please check to see if you have a runtime/tee/tf script in your agent folder?

If you do, can you try running that tf script? Do you get a list of help commands? If you do, can you try running 'tf eula" and accept it?

If it's preview agent, which version is it? We fixed something similar in vsoagent-installer 0.5.5, I want to make sure you have the latest code.

igorguga commented 8 years ago

I got the agent from the link http://aka.ms/xplatagent like described at https://github.com/Microsoft/vso-agent/blob/master/docs/onprem.md#install. It's supposed to be the regular, right? The agent version appears as 1.999.0 in TFS.

Yes I have a runtime/tee/tf in the agent folder and I can run the script. Running tf eula informs that I already have accepted the terms.

But in the PATH, I included the TEE-CLC-14.0.2 folder. Not the runtime/tee.

igorguga commented 8 years ago

I installed the preview version of the agent and I got the same errors, even the "workspace already exist" error. I notice that the preview don´t require the TEE-CLC on the PATH, but I got the same errors.

igorguga commented 8 years ago

Here are the logs I mentioned:

basherrors

firstTime_prepareWorkspace.txt

secondTime_prepareWorkspace.txt

igorguga commented 8 years ago

The issue seems to be related with the environment... Oracle Linux is supported? I know that it is a variant of RedHat, but...

In the other hand, is there any special permission requirement that aren't documented yet? Maybe in Oracle Linux some permissions can be diferent...

igorguga commented 8 years ago

@yacaovsnc after trying a lot of things with no success, I went in the direction of permissions, so I set up the agent with the TFS Service Account. For my surprise (or not) after that, everything worked perfectly.

The account I was using have this group membership: tfsbuildgroupmembership

I use this account for agents running on Windows with no problem.

The account is also member of the groups Agent Pool Administrators and Agent Pool Service Accounts for my Linux Pool Agents.

I tried to put the build account as member of Team Foundation Administrators but it had no effect, the same errors over again.

Any guess?

yacaovsnc commented 8 years ago

@igorguga just to confirm, did you reconfigure the agent yesterday?

I am not familiar with the permission requirement. You could also fix "The workspace ws_2_17;TFSBuild already exists on computer jbpaqmssr001" issue with reconfiguring the agent. This error indicates the workspace already exists somewhere else. The workspace format is "ws_sourcefolder_agentId". If you just copied over the entire agent folder, then the agent id is preserved and you will run into this problem (I assume jbpaqmssr001 is the where the original agent resides). By running the configure.sh script, we will assign a different agent id and we won't hit the naming collision anymore.

igorguga commented 8 years ago

I resolved the workspace issue deleting the workspace. Good to know that the reconfigure assign a new Id to the agent.

Now that I got the agent running (even with the service account), I'm only worried with the Cannot read property 'mappings' of null. This seems to be a bug. If it was related to permissions, the error message could express the problem better. When this happened, the shell messages indicated unexpected EOF.

I think it worth a deep investigation.

bryanmacfarlane commented 8 years ago

That's coming out of the TEE command line (not the agent). Yang is on that team.

yacaovsnc commented 8 years ago

@igorguga just want to confirm with you, do you still see the "cannot read property 'mappings' of null" error message anymore?

That error came from the fact the workspace is not created properly, and essentially we had a null pointer bug when trying to read the mappings from this non existent workspace.

igorguga commented 8 years ago

Yang,

I’ll update my agente and test.

Thank you for the reply.

Igor

From: Yang Cao [mailto:notifications@github.com] Sent: quinta-feira, 5 de maio de 2016 11:25 To: Microsoft/vso-agent vso-agent@noreply.github.com Cc: Igor Macedo igor.macedo@outlook.com; Mention mention@noreply.github.com Subject: Re: [Microsoft/vso-agent] Cannot read property 'mappings' of null (#218)

@igorguga https://github.com/igorguga just want to confirm with you, do you still see the "cannot read property 'mappings' of null" error message anymore?

That error came from the fact the workspace is not created properly, and essentially we had a null pointer bug when trying to read the mappings from this non existent workspace.

— You are receiving this because you were mentioned. Reply to this email directly or https://github.com/Microsoft/vso-agent/issues/218#issuecomment-217168078 view it on GitHub https://github.com/notifications/beacon/ANQkIDF7lJispcv1X-tS8Y9QdohiRA7Oks5p-f2xgaJpZM4Haeio.gif

bryanmacfarlane commented 8 years ago

Is this fixed?

Can you try in the new agent drop: https://github.com/Microsoft/vsts-agent

bryanmacfarlane commented 8 years ago

Ping.

bryanmacfarlane commented 8 years ago

deprecated. new agent @ https://github.com/Microsoft/vsts-agent/blob/master/README.md