Bug 1419235 - Failed to build for dotnet image
Summary: Failed to build for dotnet image
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: ImageStreams
Version: 3.5.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: XiuJuan Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-02-04 02:45 UTC by XiuJuan Wang
Modified: 2017-07-24 14:11 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-09 04:09:44 UTC
Target Upstream Version:


Attachments (Terms of Use)
Dotnet build error (17.55 KB, text/plain)
2017-02-04 02:48 UTC, XiuJuan Wang
no flags Details
dotnet build errors (33.81 KB, text/plain)
2017-02-08 05:42 UTC, XiuJuan Wang
no flags Details
dotnet loglevel 5 (419.20 KB, text/plain)
2017-02-09 02:36 UTC, XiuJuan Wang
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0884 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.5 RPM Release Advisory 2017-04-12 22:50:07 UTC

Description XiuJuan Wang 2017-02-04 02:45:50 UTC
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:

Comment 1 XiuJuan Wang 2017-02-04 02:48:47 UTC
Created attachment 1247637 [details]
Dotnet build error

Comment 2 Severin Gehwolf 2017-02-07 13:55:16 UTC
@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

Comment 3 XiuJuan Wang 2017-02-08 05:42:35 UTC
Created attachment 1248549 [details]
dotnet build errors

Comment 4 XiuJuan Wang 2017-02-08 05:43:05 UTC
@Severin Gehwolf
Still got error when create build with  dotnetcore-1.1 branch.
Paste build error.

Comment 5 Severin Gehwolf 2017-02-08 09:43:19 UTC
(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?

Comment 6 Severin Gehwolf 2017-02-08 09:51:05 UTC
Adding Omair and Tom for awareness.

Comment 7 Tom Deseyn 2017-02-08 11:06:00 UTC
It looks like a regression in the context-dir. The src folder contains both `context-dir=` and `context-dir=app`.

Comment 8 Ben Parees 2017-02-08 16:02:12 UTC
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.

Comment 9 XiuJuan Wang 2017-02-09 02:36:43 UTC
Created attachment 1248716 [details]
dotnet loglevel 5

Comment 10 XiuJuan Wang 2017-02-09 02:38:05 UTC
Severin Gehwolf  Add whole build logs, hope this will be useful for you.

Comment 11 Ben Parees 2017-02-09 03:02:18 UTC
this is due to an incomplete fix in the PR i mentioned earlier, i'll work on a fix tomorrow.

Comment 12 Ben Parees 2017-02-09 15:01:29 UTC
fix: https://github.com/openshift/origin/pull/12891

Comment 13 Troy Dawson 2017-02-10 22:47:18 UTC
This has been merged into ocp and is in OCP v3.5.0.19 or newer.

Comment 15 XiuJuan Wang 2017-02-13 05:42:27 UTC
Test in 
Server https://**:443
openshift v3.5.0.19+199197c
kubernetes v1.5.2+43a9be4

Could build dotnet app successfully.
Thanks

Comment 16 errata-xmlrpc 2017-04-12 19:11:21 UTC
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


Note You need to log in before you can comment on or make changes to this bug.