Bug 1506173

Summary: S2I behavior change between OCP 3.4 (3.4.1.24) and 3.5 (3.5.5.31.24) with regards to symlinks
Product: OpenShift Container Platform Reporter: Francesco Marchioni <fmarchio>
Component: BuildAssignee: Jim Minter <jminter>
Status: CLOSED ERRATA QA Contact: Wenjing Zheng <wzheng>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: aos-bugs, clichybi, fcami, wewang
Target Milestone: ---   
Target Release: 3.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
A regression bug was reported whereby source-to-image builds would fail if the source repository filesystem contained a broken symlink (pointing to a non-existent item). This was resolved.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-11-28 22:19:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1519822    

Description Francesco Marchioni 2017-10-25 10:24:13 UTC
Description of problem:
S2I Build fails with "Failed to fetch source for build" when git repository contains a broken link on OCP 3.5.

Version-Release number of selected component (if applicable):
3.5

How reproducible:
on a git projet create a link (ln -s) on an existing file f, delete the file f 
Or use the sample project at: https://github.com/erreff/carsten

Steps to Reproduce:
Create a project with a broken symbolic link. As an example you can use this project against a PHP template: https://github.com/erreff/carsten

Actual results:
Cloning "https://github.com/erreff/carsten" ...
	Commit:	352d2b6c173d63b7a5eb859ad6a1924a4cd506fe (add bad link)
	Author:	root <root.extra.laposte.fr>
	Date:	Tue Oct 24 18:07:29 2017 +0200
error: build error: open /tmp/s2i-build430207290/upload/src/contextdir/badlink: no such file or directory


Expected results:
In OCP 3.4, the build process is not stopped in case a symbolic link is broken.

Cloning "https://github.com/erreff/carsten" ...
	Commit:	352d2b6c173d63b7a5eb859ad6a1924a4cd506fe (add bad link)
	Author:	root <root.extra.laposte.fr>
	Date:	Tue Oct 24 18:07:29 2017 +0200

---> Installing application source...
chgrp: cannot dereference './contextdir/badlink': No such file or directory
chmod: cannot operate on dangling symlink './contextdir/badlink'


Pushing image 172.30.1.1:5000/demo/demophp:latest ...
Pushed 0/5 layers, 20% complete
Pushed 1/5 layers, 21% complete
Pushed 2/5 layers, 41% complete
Pushed 3/5 layers, 71% complete
Pushed 4/5 layers, 100% complete
Pushed 5/5 layers, 100% complete
Push successful

$ oc get pods
NAME              READY     STATUS      RESTARTS   AGE
demophp-1-0lngh   1/1       Running     0          3m
demophp-1-build   0/1       Completed   0          4m


Additional info:

Comment 5 wewang 2017-11-01 06:42:14 UTC
verified in 
oc v3.5.5.31.41
kubernetes v1.5.2+43a9be4

steps:
# oc new-app openshift/php~https://github.com/erreff/carsten -n wewang
# oc get builds -n wewang
NAME        TYPE      FROM          STATUS     STARTED              DURATION
carsten-1   Source    Git@352d2b6   Complete   About a minute ago   36s
[root@host-8-241-68 ~]# oc logs bc/carsten -n wewang
Cloning "https://github.com/erreff/carsten" ...
Pushed 4/6 layers, 74% complete
Pushed 5/6 layers, 100% complete
Pushed 6/6 layers, 100% complete
Push successful
# oc get pods
NAME              READY     STATUS      RESTARTS   AGE
carsten-1-build   0/1       Completed   0          9m
carsten-1-jhk2k   1/1       Running     0          8m

Comment 6 wewang 2017-11-07 02:13:49 UTC
Yes, it's better to have related docs text

Comment 9 errata-xmlrpc 2017-11-28 22:19:09 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/RHSA-2017:3188