Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s2i_assemble.patch fails when building locally #202

Closed
pacospace opened this issue Jul 23, 2021 · 4 comments
Closed

s2i_assemble.patch fails when building locally #202

pacospace opened this issue Jul 23, 2021 · 4 comments
Labels
human_intervention_required kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@pacospace
Copy link
Contributor

pacospace commented Jul 23, 2021

Describe the bug
s2i_assemble.patch fails when building locally

Environment variables used for s2i configuration

default ones

Expected behavior
A clear and concise description of what you expected to happen.

Actual behavior

STEP 1: FROM registry.access.redhat.com/ubi8/python-38:1-60
STEP 2: ENV SUMMARY="Thoth's Source-to-Image for Python ${PYTHON_VERSION} applications"     DESCRIPTION="Thoth's Source-to-Image for Python ${PYTHON_VERSION} applications. This toolchain is based on Red Hat UBI8. It includes pipenv."     THOTH_S2I_NAME=quay.io/thoth-station/s2i-thoth-ubi8-py38     THOTH_S2I_VERSION=0.31.0     THAMOS_NO_PROGRESSBAR=1     THAMOS_NO_EMOJI=1     MICROPIPENV_NO_LOCKFILE_PRINT=0     MICROPIPENV_NO_LOCKFILE_WRITE=0
--> Using cache 854b117aa2fa351457c3aa3e9b4d1076b5971e78e74aadb8845ddbc0983026e0
--> 854b117aa2f
STEP 3: LABEL summary="$SUMMARY"     description="$DESCRIPTION"     io.k8s.description="$DESCRIPTION"     io.k8s.display-name="Thoth Python 3.8-ubi8 S2I"     io.openshift.expose-services="8080:http"     io.openshift.tags="python,python38"     name="$THOTH_S2I_NAME:v$THOTH_S2I_VERSION"     vendor="AICoE at the Office of the CTO, Red Hat Inc."     authoritative-source-url="https://quay.io/thoth-station/s2i-thoth"     version="$THOTH_S2I_VERSION"     release="0"     ninja.thoth-station.version="0.7.0-dev"     maintainer="Thoth Station <[email protected]>"
--> Using cache febf74413bbaa7fb224a526385290d38a5df38712797ca5da35896393e3f6d6f
--> febf74413bb
STEP 4: USER 0
--> Using cache bf532e7a29af070d93434396cef423b46314ac6d90d834d24c1f8043e4f64d66
--> bf532e7a29a
STEP 5: COPY ./s2i_assemble.patch /tmp/s2i_assemble.patch
--> Using cache 874b921b7cb80de01b0e749aec29493a4e1fa24ad9c912ad9181fa16e585fa58
--> 874b921b7cb
STEP 6: RUN TMPFILE=$(mktemp) &&     TMPFILE_ASSEMBLE=$(mktemp) &&     pushd "${STI_SCRIPTS_PATH}" && patch -p 1 </tmp/s2i_assemble.patch && popd &&     pip3 install -U "pip==20.3.3" &&     /usr/bin/pip3 install -U "pip==20.3.3" &&     curl "https://raw.githubusercontent.com/thoth-station/s2i-thoth/master/ubi8-py38/requirements.txt" -o requirements.txt &&     MICROPIPENV_NO_LOCKFILE_WRITE=1 MICROPIPENV_PIP_BIN=/usr/bin/pip3 curl https://raw.githubusercontent.com/thoth-station/micropipenv/master/micropipenv.py | /usr/bin/python3 - install -- &&     curl "https://raw.githubusercontent.com/thoth-station/s2i-thoth/master/assemble" -o "${TMPFILE_ASSEMBLE}" &&     cp "${STI_SCRIPTS_PATH}/assemble" "${TMPFILE}" &&     head -n1 "${TMPFILE}" >"${STI_SCRIPTS_PATH}/assemble" &&     cat "${TMPFILE_ASSEMBLE}" >>"${STI_SCRIPTS_PATH}/assemble" &&     tail -n+2 "${TMPFILE}" >>"${STI_SCRIPTS_PATH}/assemble" &&     rm "${TMPFILE}" "${TMPFILE_ASSEMBLE}" /tmp/s2i_assemble.patch requirements.txt &&     sed -i '/  echo "---> Running application from .*/d' "${STI_SCRIPTS_PATH}/run" &&     chown -R 1001:0 ${APP_ROOT} &&     fix-permissions ${APP_ROOT} -P &&     yum update --assumeyes --nobest --setopt=tsflags=nodocs
/usr/libexec/s2i ~
patching file assemble
patch: **** malformed patch at line 40: @@ -57,16 +27,6 @@

Error: error building at STEP "RUN TMPFILE=$(mktemp) &&     TMPFILE_ASSEMBLE=$(mktemp) &&     pushd "${STI_SCRIPTS_PATH}" && patch -p 1 </tmp/s2i_assemble.patch && popd &&     pip3 install -U "pip==20.3.3" &&     /usr/bin/pip3 install -U "pip==20.3.3" &&     curl "https://raw.githubusercontent.com/thoth-station/s2i-thoth/master/ubi8-py38/requirements.txt" -o requirements.txt &&     MICROPIPENV_NO_LOCKFILE_WRITE=1 MICROPIPENV_PIP_BIN=/usr/bin/pip3 curl https://raw.githubusercontent.com/thoth-station/micropipenv/master/micropipenv.py | /usr/bin/python3 - install -- &&     curl "https://raw.githubusercontent.com/thoth-station/s2i-thoth/master/assemble" -o "${TMPFILE_ASSEMBLE}" &&     cp "${STI_SCRIPTS_PATH}/assemble" "${TMPFILE}" &&     head -n1 "${TMPFILE}" >"${STI_SCRIPTS_PATH}/assemble" &&     cat "${TMPFILE_ASSEMBLE}" >>"${STI_SCRIPTS_PATH}/assemble" &&     tail -n+2 "${TMPFILE}" >>"${STI_SCRIPTS_PATH}/assemble" &&     rm "${TMPFILE}" "${TMPFILE_ASSEMBLE}" /tmp/s2i_assemble.patch requirements.txt &&     sed -i '/  echo "---> Running application from .*/d' "${STI_SCRIPTS_PATH}/run" &&     chown -R 1001:0 ${APP_ROOT} &&     fix-permissions ${APP_ROOT} -P &&     yum update --assumeyes --nobest --setopt=tsflags=nodocs": error while running runtime: exit status 2

Additional context
Add any other context about the problem here.

Build log

A build log when running with THOTH_ASSEMBLE_DEBUG:

@pacospace pacospace added the kind/bug Categorizes issue or PR as related to a bug. label Jul 23, 2021
@pacospace
Copy link
Contributor Author

/triage accepted

@pacospace pacospace added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Jul 23, 2021
@sesheta sesheta added the triage/accepted Indicates an issue or PR is ready to be actively worked on. label Jul 23, 2021
@jgarciao
Copy link

We have a build script that uses the assemble command and it's failing since last Friday. I'm not sure if it's because of the same reason that this bug.

Here is our build log:

>>> Thoth s2i builder image version: 0.29.0
/usr/libexec/s2i/assemble: line 60: syntax error in conditional expression
/usr/libexec/s2i/assemble: line 60: syntax error near `-o'
/usr/libexec/s2i/assemble: line 60: `[[ ${THOTH_ADVISE} -ne 0 -o ${THOTH_PROVENANCE_CHECK} -ne 0 ]] && {'
error: build error: error building at STEP "RUN /tmp/scripts/assemble": error while running runtime: exit status 2

@fridex fridex mentioned this issue Jul 26, 2021
1 task
@fridex
Copy link
Contributor

fridex commented Jul 26, 2021

We have a build script that uses the assemble command and it's failing since last Friday. I'm not sure if it's because of the same reason that this bug.

Here is our build log:

>>> Thoth s2i builder image version: 0.29.0
/usr/libexec/s2i/assemble: line 60: syntax error in conditional expression
/usr/libexec/s2i/assemble: line 60: syntax error near `-o'
/usr/libexec/s2i/assemble: line 60: `[[ ${THOTH_ADVISE} -ne 0 -o ${THOTH_PROVENANCE_CHECK} -ne 0 ]] && {'
error: build error: error building at STEP "RUN /tmp/scripts/assemble": error while running runtime: exit status 2

Sorry, I introduced this issue. The fix addressed in: #206

@pacospace
Copy link
Contributor Author

Describe the bug
s2i_assemble.patch fails when building locally

Environment variables used for s2i configuration

default ones

Expected behavior
A clear and concise description of what you expected to happen.

Actual behavior

STEP 1: FROM registry.access.redhat.com/ubi8/python-38:1-60
STEP 2: ENV SUMMARY="Thoth's Source-to-Image for Python ${PYTHON_VERSION} applications"     DESCRIPTION="Thoth's Source-to-Image for Python ${PYTHON_VERSION} applications. This toolchain is based on Red Hat UBI8. It includes pipenv."     THOTH_S2I_NAME=quay.io/thoth-station/s2i-thoth-ubi8-py38     THOTH_S2I_VERSION=0.31.0     THAMOS_NO_PROGRESSBAR=1     THAMOS_NO_EMOJI=1     MICROPIPENV_NO_LOCKFILE_PRINT=0     MICROPIPENV_NO_LOCKFILE_WRITE=0
--> Using cache 854b117aa2fa351457c3aa3e9b4d1076b5971e78e74aadb8845ddbc0983026e0
--> 854b117aa2f
STEP 3: LABEL summary="$SUMMARY"     description="$DESCRIPTION"     io.k8s.description="$DESCRIPTION"     io.k8s.display-name="Thoth Python 3.8-ubi8 S2I"     io.openshift.expose-services="8080:http"     io.openshift.tags="python,python38"     name="$THOTH_S2I_NAME:v$THOTH_S2I_VERSION"     vendor="AICoE at the Office of the CTO, Red Hat Inc."     authoritative-source-url="https://quay.io/thoth-station/s2i-thoth"     version="$THOTH_S2I_VERSION"     release="0"     ninja.thoth-station.version="0.7.0-dev"     maintainer="Thoth Station <[email protected]>"
--> Using cache febf74413bbaa7fb224a526385290d38a5df38712797ca5da35896393e3f6d6f
--> febf74413bb
STEP 4: USER 0
--> Using cache bf532e7a29af070d93434396cef423b46314ac6d90d834d24c1f8043e4f64d66
--> bf532e7a29a
STEP 5: COPY ./s2i_assemble.patch /tmp/s2i_assemble.patch
--> Using cache 874b921b7cb80de01b0e749aec29493a4e1fa24ad9c912ad9181fa16e585fa58
--> 874b921b7cb
STEP 6: RUN TMPFILE=$(mktemp) &&     TMPFILE_ASSEMBLE=$(mktemp) &&     pushd "${STI_SCRIPTS_PATH}" && patch -p 1 </tmp/s2i_assemble.patch && popd &&     pip3 install -U "pip==20.3.3" &&     /usr/bin/pip3 install -U "pip==20.3.3" &&     curl "https://raw.githubusercontent.com/thoth-station/s2i-thoth/master/ubi8-py38/requirements.txt" -o requirements.txt &&     MICROPIPENV_NO_LOCKFILE_WRITE=1 MICROPIPENV_PIP_BIN=/usr/bin/pip3 curl https://raw.githubusercontent.com/thoth-station/micropipenv/master/micropipenv.py | /usr/bin/python3 - install -- &&     curl "https://raw.githubusercontent.com/thoth-station/s2i-thoth/master/assemble" -o "${TMPFILE_ASSEMBLE}" &&     cp "${STI_SCRIPTS_PATH}/assemble" "${TMPFILE}" &&     head -n1 "${TMPFILE}" >"${STI_SCRIPTS_PATH}/assemble" &&     cat "${TMPFILE_ASSEMBLE}" >>"${STI_SCRIPTS_PATH}/assemble" &&     tail -n+2 "${TMPFILE}" >>"${STI_SCRIPTS_PATH}/assemble" &&     rm "${TMPFILE}" "${TMPFILE_ASSEMBLE}" /tmp/s2i_assemble.patch requirements.txt &&     sed -i '/  echo "---> Running application from .*/d' "${STI_SCRIPTS_PATH}/run" &&     chown -R 1001:0 ${APP_ROOT} &&     fix-permissions ${APP_ROOT} -P &&     yum update --assumeyes --nobest --setopt=tsflags=nodocs
/usr/libexec/s2i ~
patching file assemble
patch: **** malformed patch at line 40: @@ -57,16 +27,6 @@

Error: error building at STEP "RUN TMPFILE=$(mktemp) &&     TMPFILE_ASSEMBLE=$(mktemp) &&     pushd "${STI_SCRIPTS_PATH}" && patch -p 1 </tmp/s2i_assemble.patch && popd &&     pip3 install -U "pip==20.3.3" &&     /usr/bin/pip3 install -U "pip==20.3.3" &&     curl "https://raw.githubusercontent.com/thoth-station/s2i-thoth/master/ubi8-py38/requirements.txt" -o requirements.txt &&     MICROPIPENV_NO_LOCKFILE_WRITE=1 MICROPIPENV_PIP_BIN=/usr/bin/pip3 curl https://raw.githubusercontent.com/thoth-station/micropipenv/master/micropipenv.py | /usr/bin/python3 - install -- &&     curl "https://raw.githubusercontent.com/thoth-station/s2i-thoth/master/assemble" -o "${TMPFILE_ASSEMBLE}" &&     cp "${STI_SCRIPTS_PATH}/assemble" "${TMPFILE}" &&     head -n1 "${TMPFILE}" >"${STI_SCRIPTS_PATH}/assemble" &&     cat "${TMPFILE_ASSEMBLE}" >>"${STI_SCRIPTS_PATH}/assemble" &&     tail -n+2 "${TMPFILE}" >>"${STI_SCRIPTS_PATH}/assemble" &&     rm "${TMPFILE}" "${TMPFILE_ASSEMBLE}" /tmp/s2i_assemble.patch requirements.txt &&     sed -i '/  echo "---> Running application from .*/d' "${STI_SCRIPTS_PATH}/run" &&     chown -R 1001:0 ${APP_ROOT} &&     fix-permissions ${APP_ROOT} -P &&     yum update --assumeyes --nobest --setopt=tsflags=nodocs": error while running runtime: exit status 2

Additional context
Add any other context about the problem here.

Build log

A build log when running with THOTH_ASSEMBLE_DEBUG:

Thanks @fridex ! this seems to not be there anymore! we can close this issue I think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
human_intervention_required kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

4 participants