NuGet / NuGetGallery

NuGet Gallery is a package repository that powers https://www.nuget.org. Use this repo for reporting NuGet.org issues.
https://www.nuget.org/
Apache License 2.0
1.54k stars 643 forks source link

nuget.exe no longer working on mono #2559

Closed gmarz closed 9 years ago

gmarz commented 9 years ago

Hey folks,

Our Travis CI build on Mono has suddenly stopped working: https://travis-ci.org/elastic/elasticsearch-net/builds/68155997#L966

Cannot open assembly 'build/tools/nuget/nuget.exe': File does not contain a valid CIL image.

Our build script can be found here. We're downloading the latest binary from https://nugetbuild.cloudapp.net/drops/client/master/NuGet.exe.

Here's the output when I run it from mono in trace mode:

mono --trace --runtime=v4.0 nuget.exe install FAKE
[00001B58: 0.00000 0] ENTER: (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)([System.OutOfMemoryException:02000518], 0018FD94, 00000000, 036C0D20, )
[00001B58: 0.00511 1] ENTER: System.OutOfMemoryException:.ctor (string)(this:02000518[System.OutOfMemoryException nuget.exe], [STRING:020004F0:Out of memory], )
[00001B58: 0.01013 2] ENTER: System.SystemException:.ctor (string)(this:02000518[System.OutOfMemoryException nuget.exe], [STRING:020004F0:Out of memory], )
[00001B58: 0.01393 3] ENTER: System.Exception:.ctor (string)(this:02000518[System.OutOfMemoryException nuget.exe], [STRING:020004F0:Out of memory], )
[00001B58: 0.01736 3] LEAVE: System.Exception:.ctor (string)
[00001B58: 0.01884 2] LEAVE: System.SystemException:.ctor (string)
[00001B58: 0.02035 1] LEAVE: System.OutOfMemoryException:.ctor (string)
[00001B58: 0.02210 0] LEAVE: (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)[OBJECT:00000000]
[00001B58: 0.02616 0] ENTER: (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)([System.NullReferenceException:020005F8], 0018FD78, 00000000, 036C0F40, )
[00001B58: 0.03134 1] ENTER: System.NullReferenceException:.ctor (string)(this:020005F8[System.NullReferenceException nuget.exe], [STRING:02000570:A null value was found where an object instance was required], )
[00001B58: 0.03625 2] ENTER: System.SystemException:.ctor (string)(this:020005F8[System.NullReferenceException nuget.exe], [STRING:02000570:A null value was found where an object instance was required], )
[00001B58: 0.04087 3] ENTER: System.Exception:.ctor (string)(this:020005F8[System.NullReferenceException nuget.exe], [STRING:02000570:A null value was found where an object instance was required], )
[00001B58: 0.04801 3] LEAVE: System.Exception:.ctor (string)
[00001B58: 0.04979 2] LEAVE: System.SystemException:.ctor (string)
[00001B58: 0.05131 1] LEAVE: System.NullReferenceException:.ctor (string)
[00001B58: 0.05292 0] LEAVE: (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)[OBJECT:00000000]
[00001B58: 0.05866 0] ENTER: (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)([System.StackOverflowException:020006A8], 0018FD9C, 00000000, 036C0F90, )
[00001B58: 0.06503 1] ENTER: System.StackOverflowException:.ctor (string)(this:020006A8[System.StackOverflowException nuget.exe], [STRING:02000638:The requested operation caused a stack overflow.], )
[00001B58: 0.07019 2] ENTER: System.SystemException:.ctor (string)(this:020006A8[System.StackOverflowException nuget.exe], [STRING:02000638:The requested operation caused a stack overflow.], )
[00001B58: 0.07372 3] ENTER: System.Exception:.ctor (string)(this:020006A8[System.StackOverflowException nuget.exe], [STRING:02000638:The requested operation caused a stack overflow.], )
[00001B58: 0.07818 3] LEAVE: System.Exception:.ctor (string)
[00001B58: 0.08074 2] LEAVE: System.SystemException:.ctor (string)
[00001B58: 0.08217 1] LEAVE: System.StackOverflowException:.ctor (string)
[00001B58: 0.08331 0] LEAVE: (wrapper runtime-invoke) <Module>:runtime_invoke_void__this___object (object,intptr,intptr,intptr)[OBJECT:00000000]
Cannot open assembly 'build/tools/nuget/nuget.exe': File does not contain a valid CIL image.
[0000124C: 0.09006 0] ENTER: (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr)([System.Threading.Thread:0382C150], 00000000, 0398FDF0, 00000000, )
[0000124C: 0.09741 1] ENTER: System.Threading.Thread:Finalize ()(this:0382C150[System.Threading.Thread nuget.exe], )
[0000124C: 0.10010 2] ENTER: System.Runtime.ConstrainedExecution.CriticalFinalizerObject:Finalize ()(this:0382C150[System.Threading.Thread nuget.exe], )
[0000124C: 0.10327 2] LEAVE: System.Runtime.ConstrainedExecution.CriticalFinalizerObject:Finalize ()
[0000124C: 0.10637 1] LEAVE: System.Threading.Thread:Finalize ()
[0000124C: 0.10771 0] LEAVE: (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr)[OBJECT:00000000]
[0000124C: 0.11070 0] ENTER: (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr)([System.Threading.InternalThread:03830120], 00000000, 0398FDF0, 00000000, )
[0000124C: 0.11570 1] ENTER: System.Threading.InternalThread:Finalize ()(this:03830120[System.Threading.InternalThread nuget.exe], )
[0000124C: 0.12013 2] ENTER: (wrapper managed-to-native) System.Threading.InternalThread:Thread_free_internal (System.Threading.InternalThread,intptr)([System.Threading.InternalThread:03830120], 00000170, )
[0000124C: 0.12480 2] LEAVE: (wrapper managed-to-native) System.Threading.InternalThread:Thread_free_internal (System.Threading.InternalThread,intptr)
[0000124C: 0.12990 2] ENTER: System.Runtime.ConstrainedExecution.CriticalFinalizerObject:Finalize ()(this:03830120[System.Threading.InternalThread nuget.exe], )
[0000124C: 0.13295 2] LEAVE: System.Runtime.ConstrainedExecution.CriticalFinalizerObject:Finalize ()
[0000124C: 0.13488 1] LEAVE: System.Threading.InternalThread:Finalize ()
[0000124C: 0.13638 0] LEAVE: (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr)[OBJECT:00000000]
[0000124C: 0.13872 0] ENTER: (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr)([System.Threading.Thread:0382C120], 00000000, 0398FDF0, 00000000, )
[0000124C: 0.14230 1] ENTER: System.Threading.Thread:Finalize ()(this:0382C120[System.Threading.Thread nuget.exe], )
[0000124C: 0.16309 2] ENTER: System.Runtime.ConstrainedExecution.CriticalFinalizerObject:Finalize ()(this:0382C120[System.Threading.Thread nuget.exe], )
[0000124C: 0.16647 2] LEAVE: System.Runtime.ConstrainedExecution.CriticalFinalizerObject:Finalize ()
[0000124C: 0.16832 1] LEAVE: System.Threading.Thread:Finalize ()
[0000124C: 0.16947 0] LEAVE: (wrapper runtime-invoke) object:runtime_invoke_virtual_void__this__ (object,intptr,intptr,intptr)[OBJECT:00000000]

Are we doing something wrong or is this an issue? Happy to provide more info if needed.

maartenba commented 9 years ago

Can you run this again? We've had a partial degradation earlier today that may have caused this.

gmarz commented 9 years ago

Just ran it again, same issue.

maartenba commented 9 years ago

Overlooked something: the https://nugetbuild.cloudapp.net/drops/client/master/NuGet.exe URL is now https://www.nuget.org/nuget.exe.

gmarz commented 9 years ago

Still running into the same error even when pointing to https://www.nuget.org/nuget.exe. Are you able to reproduce this at all?

maartenba commented 9 years ago

Adding @emgarten - this should be a Mono-compatible build, no?

emgarten commented 9 years ago

nuget.exe should work on mono, but this isn't something that gets regular testing.

@gmarz is this a recent regression? Do older builds of nuget.exe work for you?

gmarz commented 9 years ago

@emgarten yes, this is definitely a recent regression. The earliest I can trace it back to working was 2 days ago: https://travis-ci.org/elastic/elasticsearch-net/builds/67853275. Our build script hasn't changed in months.

I assume it will work with older versions of nuget.exe, but I don't have any on hand to test. Is there a way to pull an older version?

emgarten commented 9 years ago

nuget.exe hasn't been updated since April.

You can find older versions in the tools folder of the nupkgs here: https://www.nuget.org/packages/NuGet.CommandLine/

gmarz commented 9 years ago

nuget.exe hasn't been updated since April.

Our build script downloads the latest build from https://nugetbuild.cloudapp.net/drops/client/master/NuGet.exe since we prefer to download nuget.exe on the server rather than checking it in to source control, so I'm assuming this is an issue in master.

You can find older versions in the tools folder of the nupkgs here: https://www.nuget.org/packages/NuGet.CommandLine/

Sorry, should have been more clear. Was curious if there was a way an alternative way to download and older verison of nuget.exe (like above) rather than using nuget itself. Not a big deal...I've checked in nuget.exe v2.8.5 into our repo and I'm testing the Travis build now- will keep you posted.

gmarz commented 9 years ago

FYI the build passes on the latest stable v2.8.5 https://travis-ci.org/elastic/elasticsearch-net/builds/68212492. So this is indeed an issue in the current trunk.

gmarz commented 9 years ago

Okay, this is embarrassing. The issue was that https://nugetbuild.cloudapp.net/drops/client/master/NuGet.exe now redirects to https://api.nuget.org/downloads/nuget.exe.

The curl command was downloading the redirect response, so nuget.exe was essentially a web page. That certainly explains "File does not contain a valid CIL image" :)

Bit of a sneaky issue...appreciate the help here @maartenba and @emgarten. Sorry for wasting your time.

gmarz commented 9 years ago

Bah, correction. https://nugetbuild.cloudapp.net/drops/client/master/NuGet.exe returns a 403, and https://www.nuget.org/nuget.exe redirects to https://api.nuget.org/downloads/nuget.exe.

In both cases, curl was downloading the html as nuget.exe. Pointing to https://api.nuget.org/downloads/nuget.exe directly fixes our issue.

Sorry for the confusion.

davincif commented 5 years ago

@gmarz, ok, got it, but how do you solved it? I've installed mono by doing:? sudo apt-get install mono-complet and then following this: https://www.mono-project.com/download/stable/#download-lin 1º is that my monodevelop is totaly broken, just impossible to use; 2º when I try to run "mono file.cs" a got the msg: Cannot open assembly 'test1.cs': File does not contain a valid CIL image. so??...