Skip to content
This repository has been archived by the owner. It is now read-only.

DNX is not available/restored when running under service account #2239

Closed
jochenvanwylick opened this issue Jul 10, 2015 · 15 comments
Closed

DNX is not available/restored when running under service account #2239

jochenvanwylick opened this issue Jul 10, 2015 · 15 comments

Comments

@jochenvanwylick
Copy link

@jochenvanwylick jochenvanwylick commented Jul 10, 2015

I've created a vNext web app, which builds locally and which builds on the build server only when I rdp into the server, open VS 2015RC and build the app.

However, it doesn't build when being built by the TFS agent, which is what I want, since this serves as CI build box. I get error message:

Error : The Dnx Runtime package needs to be installed. See output window for more details.

Checked all the DNX versions installed and settings, but it all seems OK ( dnvm list identical local and CI box ). So - trying to solve this I set up a new VSO build. I donwloaded the agent and ran the configuration powershell script on the box and ran under the user account. Build works - all is good.
Then - in order to still work after server update - I re-ran configuration script and installed the agent under the service account. Build breaks - same error message:

Error : The Dnx Runtime package needs to be installed. See output window for more details.

So once more - ran config script - agent is now under user account again, and build works again.
This pattern matches the fact that the TFS agent couldn't build, but me from VS2015 could.

Did I do something wrong or is this maybe something that needs to be changed?

Info on the setup:
Using 1.0.0-beta5 on local machine and CI box. Web project does not require specific version of DNX. Using Visualstudio.com with a TFS build agent on the CI box and now also the new build agent for VSO builds.

@muratg
Copy link
Contributor

@muratg muratg commented Jul 10, 2015

DNX bits are installed under user profiles. Does the service account have a user profile?

Are you able to create a proper user on the machine and run agent under that user?

@jochenvanwylick
Copy link
Author

@jochenvanwylick jochenvanwylick commented Jul 10, 2015

Hi - sure I can do that. I think the service account which the agent defaulted to - doesn't. But in a CI server scenario, is that desirable?

@pranavkm
Copy link
Contributor

@pranavkm pranavkm commented Jul 10, 2015

@jochenvanwylick, you could consider setting theDNX_HOME environment variable to change where dnx is installed.

@muratg
Copy link
Contributor

@muratg muratg commented Jul 10, 2015

Yup, that should work too. Closing for now, @jochenvanwylick please reactivate if you still see issues.

@muratg muratg closed this as completed Jul 10, 2015
@eugeneagafonov
Copy link

@eugeneagafonov eugeneagafonov commented Aug 11, 2015

Setting the DNX_HOME environment variable does not work for me. My setup is TFS 2015 build agent on windows 2012R2, VS 2015 Pro installed, I run the build agent under domain account. The build agent keeps looking dnx under default path.

@pranavkm
Copy link
Contributor

@pranavkm pranavkm commented Aug 26, 2015

@eugeneagafonov we've been using the setting on our CI of late and it works pretty well. Are you certain the build agent is actually picking up the environment variable (maybe it needs to be restarted if it's a service?)

@AntonLosev
Copy link

@AntonLosev AntonLosev commented Aug 26, 2015

I had this error.

Error : The Dnx Runtime package needs to be installed. See output window for more details.

I added steps for build -
Install NuGet with command -source "https://www.nuget.org/api/v2/;https://api.nuget.org/v3/"
and I added powerShell command for install DNX
Now i have error:

2015-08-26T07:31:44.4260967Z ##[error]src\Volga\Startup.cs(1,17): Error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

2015-08-26T07:31:44.4270974Z      2>H:\TfsData\Build\_work\960b9b9c\Volga\src\Volga\Startup.cs(1,17): DNX,Version=v4.6 error CS0234: The type or namespace name 'AspNet' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [H:\TfsData\Build\_work\960b9b9c\Volga\src\Volga\Volga.xproj]

Waiting betta7 :(

@jochenvanwylick
Copy link
Author

@jochenvanwylick jochenvanwylick commented Aug 26, 2015

@AntonLosev You may have to run dnu restore - seems you're just missing the DLLs.

@AntonLosev
Copy link

@AntonLosev AntonLosev commented Aug 27, 2015

@jochenvanwylick

C:\>dnu restore
Microsoft .NET Development Utility CLR-x86-1.0.0-beta6-12256

----------
System.UnauthorizedAccessException: Отказано в доступе по пути "C:\Docum
 Settings\All Users\Application Data\Application Data\Application Data\A
on Data\Application Data\Application Data\Application Data\Application D
ication Data\Application Data\Application Data\Documents\My Videos".

@AntonLosev
Copy link

@AntonLosev AntonLosev commented Aug 27, 2015

I changed my permissions and now have error

C:\>dnu restore
Microsoft .NET Development Utility CLR-x86-1.0.0-beta6-12256

----------
System.UnauthorizedAccessException: Отказано в доступе по пути "C:\Documents and
 Settings\All Users\Application Data\Application Data\Application Data\Applicati
on Data\Application Data\Application Data\Application Data\Application Data\Appl
ication Data\Application Data\Application Data\Microsoft\Windows\SystemData".
   в System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   в System.IO.FileSystemEnumerableIterator`1.AddSearchableDirsToStack(SearchDat
a localSearchData)
   в System.IO.FileSystemEnumerableIterator`1.MoveNext()
   в System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 co
llection)
   в Microsoft.Framework.PackageManager.RestoreCommand.<Execute>d__69.MoveNext()

----------
Restore failed
Отказано в доступе по пути "C:\Documents and Settings\All Users\Application Data
\Application Data\Application Data\Application Data\Application Data\Application
 Data\Application Data\Application Data\Application Data\Application Data\Applic
ation Data\Microsoft\Windows\SystemData".
System.NullReferenceException: Ссылка на объект не указывает на экземпляр объект
а.
   в Microsoft.Framework.PackageManager.RestoreCommand.<Execute>d__68.MoveNext()

--- Конец трассировка стека из предыдущего расположения, где возникло исключение
 ---
   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNoti
fication(Task task)
   в Microsoft.Framework.PackageManager.RestoreConsoleCommand.<>c__DisplayClass0
_0.<<Register>b__1>d.MoveNext()

C:\>

I can't change permissions for SystemData
What for DNU have access in myVideo and in others folders?

@eugeneagafonov
Copy link

@eugeneagafonov eugeneagafonov commented Oct 1, 2015

@pranavkm Yes I'm sure, I've restarted the server, checked env variables for the build agent account, and it still does not work.
Is there any option to install dnvm/dnx globally on server, not in every user profile?

@pranavkm
Copy link
Contributor

@pranavkm pranavkm commented Oct 1, 2015

Outside of DNX_HOME, I don't think there's a way to specify where DNX is installed. For one, it might be useful to get the verbose log from your dnvm install and file an issue at https://github.com/aspnet/dnvm.

You could try extracting the latest DNX package (nuget install dnx-clr-win-x86 -source https://www.nuget.org/api/v2) and simply running commands from it's bin directory.

@muratg
Copy link
Contributor

@muratg muratg commented Oct 1, 2015

@eugeneagafonov In Beta 8 DNVM has -g flag to install DNXs globally.

@ABrehm264
Copy link

@ABrehm264 ABrehm264 commented Jan 8, 2016

What are the instructions for setting DNX_HOME? I haven't been able to find them.

@dearprudence
Copy link

@dearprudence dearprudence commented May 17, 2016

What a total debacle.

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

7 participants