3

I am attempting to build and deploy a dotnetcore based ASP.NET application (with AngularJS) on OpenShift Container platform. The build operation is failing with the following error:

chgrp: changing group of '/opt/app-root/src/..1981_10_01_08_47_25.068924002/.gitconfig': Operation not permitted
chgrp: changing group of '/opt/app-root/src/..1981_10_01_08_47_25.068924002/password': Operation not permitted
chgrp: changing group of '/opt/app-root/src/..1981_10_01_08_47_25.068924002/username': Operation not permitted
chgrp: changing group of '/opt/app-root/src/..1981_10_01_08_47_25.068924002': Operation not permitted
chgrp: changing group of '/opt/app-root/src/..data': Operation not permitted
chgrp: changing group of '/opt/app-root/src/.gitconfig': Operation not permitted
chgrp: changing group of '/opt/app-root/src/password': Operation not permitted
chgrp: changing group of '/opt/app-root/src/username': Operation not permitted
chmod: changing permissions of '/opt/app-root/src/..1981_10_01_08_47_25.068924002': Operation not permitted
chmod: changing permissions of '/opt/app-root/src/..1981_10_01_08_47_25.068924002/.gitconfig': Operation not permitted
chmod: changing permissions of '/opt/app-root/src/..1981_10_01_08_47_25.068924002/password': Operation not permitted
chmod: changing permissions of '/opt/app-root/src/..1981_10_01_08_47_25.068924002/username': Operation not permitted
chmod: changing permissions of '/opt/app-root/src/..1981_10_01_08_47_25.068924002': Operation not permitted

error: build error: non-zero (13) exit code from registry.access.redhat.com/dotnet/dotnet-20-rhel7@sha256:0dbafdca780475373a34be07877b152f94ff7ef4168758f1f9011bc71793245f

I am opting to perform source2image build. So, I am not sure what is wrong. Can someone advise? thanks.

Prasanna K Rao
  • 1,086
  • 2
  • 8
  • 18
  • Can you confirm whether you are using build secrets and if so how that was setup? – Graham Dumpleton Jan 10 '18 at 19:54
  • hi @GrahamDumpleton. Yes. I am using build secret, setup using a template and looks like below: `- apiVersion: v1 data: .gitconfig: xxxx password: xxx username: xxx kind: Secret metadata: name: builder type: kubernetes.io/basic-auth ` – Prasanna K Rao Jan 11 '18 at 10:03
  • Can you try using ``dotnet/dotnet-20-centos7``? The rhel based version you are using may be out of date. I want to see if the latest centos7 version has the same issue. – Graham Dumpleton Jan 12 '18 at 03:45
  • ok. I found the reason for the error. The s2i utility uses [this](https://github.com/redhat-developer/s2i-dotnetcore/blob/master/2.0/build/s2i/bin/assemble) script during build process. Code at line no 121 of this script is causing the issue. I created a local copy of this file and removed references to `fix-permissions` script and all looks good now. thanks – Prasanna K Rao Jan 12 '18 at 10:40
  • The reason I asked you to try the ``centos7`` image is that depending on how the ``fix-permissions`` script gets into the image, it may have a fixed version which avoids this problem. Can you get into the running pod and see what is in ``fix-permissions``? You want to see what is given in https://github.com/sclorg/s2i-base-container/blob/master/core/root/usr/bin/fix-permissions If it isn't, you have older version which has this problem. – Graham Dumpleton Jan 12 '18 at 11:45
  • I couldn't work out whether that ``dotnet`` image is built off that ``s2i-base-container`` or whether they have their own copy of ``fix-permissions`` which isn't the same. Rather than not call ``fix-permissions``, which you should do to avoid other problems, replace ``fix-permissions`` with what is at https://github.com/sclorg/s2i-base-container/blob/master/core/root/usr/bin/fix-permissions and indicate whether that then works. – Graham Dumpleton Jan 12 '18 at 11:48
  • FIW, the sources of both RHEL-based containers (`dotnet/dotnet-20-rhel7`) and CentOS-based containers (`dotnet/dotnet-20-centos7`) are available here: https://github.com/redhat-developer/s2i-dotnetcore/. The `fix-permissions` script is located at https://github.com/redhat-developer/s2i-dotnetcore/blob/master/2.0/runtime/root/usr/bin/fix-permissions. – omajid Mar 06 '18 at 05:07
  • @PrasannaKRao Could you please file a bug here with more details: https://github.com/redhat-developer/s2i-dotnetcore/issues ? – omajid Mar 06 '18 at 05:09

1 Answers1

1

I found the reason for the error and a workaround as well. The reason was the s2i script calling the assemble script available here. There is a call to fix-permissions at line no 121 that is causing me issues.

To fix the issue, I created a local copy of this assemble script and commented out these lines and that resolved the issue.

I was able to build and deploy my application ok. thanks

Prasanna K Rao
  • 1,086
  • 2
  • 8
  • 18