Description of problem: Failed to build for dotnet image with below error Project src (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing Compiling src for .NETCoreApp,Version=v1.0 /opt/rh/rh-dotnetcore10/root/usr/lib64/dotnetcore/dotnet compile-csc @/opt/app-root/src/obj/Release/netcoreapp1.0/dotnet-compile.rsp returned Exit Code 1 /opt/app-root/src/app/Program.cs(11,18): error CS0101: The namespace 'WebApplication' already contains a definition for 'Program' /opt/app-root/src/app/Startup.cs(18,18): error CS0101: The namespace 'WebApplication' already contains a definition for 'Startup' /opt/app-root/src/app/Models/ApplicationUser.cs(10,18): error CS0101: The namespace 'WebApplication.Models' already contains a definition for 'ApplicationUser' /opt/app-root/src/app/Program.cs(13,28): error CS0111: Type 'Program' already defines a member called 'Main' with the same parameter types /opt/app-root/src/app/Data/ApplicationDbContext.cs(11,18): error CS0101: The namespace 'WebApplication.Data' already contains a definition for 'ApplicationDbContext' error: build error: non-zero (13) exit code from registry.ops.openshift.com/dotnet/dotnetcore-11-rhel7@sha256:f2ba519cc867065c25b6cf741521e45196f1b4df6d77792c9598119d8bf437a8 Version-Release number of selected component (if applicable): oc v3.3.1.12 kubernetes v1.3.0+52492b4 features: Basic-Auth GSSAPI Kerberos SPNEGO Server https://***:8443 openshift v3.5.0.16+a26133a kubernetes v1.5.2+43a9be4 How reproducible: always Steps to Reproduce: 1.Create a dotnet app. oc new-build openshift/dotnet:latest~https://github.com/openshift-s2i/s2i-aspnet-example --context-dir=app 2.Check build logs 3. Actual results: Faild to build with below errors Project src (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing Compiling src for .NETCoreApp,Version=v1.0 /opt/rh/rh-dotnetcore10/root/usr/lib64/dotnetcore/dotnet compile-csc @/opt/app-root/src/obj/Release/netcoreapp1.0/dotnet-compile.rsp returned Exit Code 1 /opt/app-root/src/app/Program.cs(11,18): error CS0101: The namespace 'WebApplication' already contains a definition for 'Program' /opt/app-root/src/app/Startup.cs(18,18): error CS0101: The namespace 'WebApplication' already contains a definition for 'Startup' /opt/app-root/src/app/Models/ApplicationUser.cs(10,18): error CS0101: The namespace 'WebApplication.Models' already contains a definition for 'ApplicationUser' /opt/app-root/src/app/Program.cs(13,28): error CS0111: Type 'Program' already defines a member called 'Main' with the same parameter types /opt/app-root/src/app/Data/ApplicationDbContext.cs(11,18): error CS0101: The namespace 'WebApplication.Data' already contains a definition for 'ApplicationDbContext' error: build error: non-zero (13) exit code from registry.ops.openshift.com/dotnet/dotnetcore-11-rhel7@sha256:f2ba519cc867065c25b6cf741521e45196f1b4df6d77792c9598119d8bf437a8 Expected results: The build should succeed Additional info:
Created attachment 1247637 [details] Dotnet build error
@XinJuan Wang Try this instead (only the dotnetcore-1.1 branch has 1.1 support): $ oc new-build openshift/dotnet:latest~https://github.com/openshift-s2i/s2i-aspnet-example#dotnetcore-1.1 --context-dir=app
Created attachment 1248549 [details] dotnet build errors
@Severin Gehwolf Still got error when create build with dotnetcore-1.1 branch. Paste build error.
(In reply to XiuJuan Wang from comment #4) > @Severin Gehwolf > Still got error when create build with dotnetcore-1.1 branch. > Paste build error. Thanks! XiuJuan: Please paste the full log. There should be some trace about "---> Installing dependencies ..." which I don't see in the attachment in comment 3. The following is also something interesting: Server https://***:8443 openshift v3.5.0.16+a26133a kubernetes v1.5.2+43a9be4 ^--- Is this based on OpenShift Origin 1.5.0 Alpha2? We've had a report upstream that the image does not work on 1.5.0 Alpha2: https://github.com/redhat-developer/s2i-dotnetcore/issues/43 Unfortunately, I'm having a hard time getting OS Origin 1.5.0 Alpha2 set up. "oc cluster up" fails with some strange error for me on F25. Here is what we do know: The sample app (redhat-developer/s2i-dotnetcore-ex) works with the released 1.1 dotnet image on OS origin v1.4.1 and v1.3.x. It fails with something strange in 1.5.0 Alpha2. So 1.5 seems to have regressed. I'm unsure why. I'm not convinced (yet) that this is a dotnet image issue as I don't know the changes that have happened between 1.4.x => 1.5.x OS origin which might cause this. What's odd is this from the upstream report: ---> Copying application source ... ---> Installing dependencies ... log : Restoring packages for /opt/app-root/src/project.json... log : Restoring packages for /opt/app-root/src/app/project.json... There should only be one project.json *not* two. The github sources only has it in app/project.json. Maybe this is some bug in s2i? Ben, your thoughts? How would we go about debugging this?
Adding Omair and Tom for awareness.
It looks like a regression in the context-dir. The src folder contains both `context-dir=` and `context-dir=app`.
sounds like that OCP build is missing this fix: https://github.com/openshift/origin/pull/12628 the fix is part of the registry.access.redhat.com/openshift3/ose-sti-builder image, so perhaps the cluster wasn't using an updated image (or one hasn't been built?) loglevel 5 output for the build will show us what the version of the sti-builder image is.
Created attachment 1248716 [details] dotnet loglevel 5
Severin Gehwolf Add whole build logs, hope this will be useful for you.
this is due to an incomplete fix in the PR i mentioned earlier, i'll work on a fix tomorrow.
fix: https://github.com/openshift/origin/pull/12891
This has been merged into ocp and is in OCP v3.5.0.19 or newer.
Test in Server https://**:443 openshift v3.5.0.19+199197c kubernetes v1.5.2+43a9be4 Could build dotnet app successfully. Thanks
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:0884