-
Notifications
You must be signed in to change notification settings - Fork 14
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
2535 - Crash Loop Back offs Error #2577
Changes from all commits
d94b617
644e455
6dc5caa
3e79d87
f987c4c
280934f
4924fbd
385f647
36c5f1f
61b074b
af8dc39
3ac6dad
bcb4fdc
b8d28ad
17d2ce4
dc92dd9
41ac5b5
8da308b
ae6ea9d
e1678f3
2307fc0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,28 +5,6 @@ kind: Template | |
metadata: | ||
name: ${NAME} | ||
objects: | ||
- apiVersion: image.openshift.io/v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For my understanding, what was the effect of having it before and not having it now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To answer your question straight, the configuration was not configured properly and it was not at all used in our project. |
||
kind: ImageStream | ||
metadata: | ||
name: ${BASE_IMAGE_NAME} | ||
spec: | ||
lookupPolicy: | ||
local: false | ||
- apiVersion: v1 | ||
kind: ImageStreamTag | ||
lookupPolicy: | ||
local: false | ||
metadata: | ||
name: ${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} | ||
tag: | ||
annotations: null | ||
from: | ||
kind: DockerImage | ||
name: ${BASE_IMAGE_REPO}${BASE_IMAGE_NAME}:${BASE_IMAGE_TAG} | ||
importPolicy: | ||
scheduled: true | ||
referencePolicy: | ||
type: Source | ||
- kind: ImageStream | ||
apiVersion: v1 | ||
metadata: | ||
|
@@ -88,11 +66,6 @@ parameters: | |
value: Dockerfile | ||
- name: TAG | ||
value: "latest" | ||
- name: BASE_IMAGE_REPO | ||
- name: BASE_IMAGE_NAME | ||
required: true | ||
- name: BASE_IMAGE_TAG | ||
required: true | ||
- name: CPU_LIMIT | ||
value: "2" | ||
- name: MEMORY_LIMIT | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Base Image | ||
FROM artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/nodejs-18:1-71.1697652955 | ||
FROM artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/nodejs-18:1-81 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While I support the node upgrade either way and the research looks great, we are still missing the root cause. 1 - Even the Openshift docker image defining a non-root user 1001, the container will be executed with a random user, as the error in the ticket also points out. 2 - Checking the BC git I found at least one entry applying the recommended solution due to a npm 9 issue. The above would also explain why the error started when we moved from node 16 to 18 (npm 8 to 10). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see and I agree what @andrewsignori-aot about the OpenShift container running with arbitrarily assigned user. I am 100% on same page that we need to run a fix permission command to have the highest level of certainty that the issue is taken care at it's root cause. When I look at the openshift, see that write permissions are not present outside the owner for the directory. There is one more thing which I want to share here @guru-aot @andrewsignori-aot @cditcher . It may also be a possible solution or may be not. But I would recommend to try. Please go through this thread, sclorg/s2i-nodejs-container#396 There is a mention about same error (we are using npm ci) Following screenshots are the highlights linking to our issue Docker s2i example:(May be by this way we make the container to run with 1001 user instead of default arbitrarily assigned one) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the suggestions @andrewsignori-aot and @dheepak-aot , as suggested, i have updated the group permissions for user in group 0 to have write access to the folder./.npm and tested the build and deployments. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the further verifications @dheepak-aot 😉 |
||
|
||
LABEL maintainer="BC GOV" | ||
|
||
|
@@ -23,5 +23,10 @@ RUN npm run build api | |
# Exposing application port | ||
EXPOSE ${PORT} | ||
|
||
# Grant access to group 0 to allow npm v9 to work | ||
# See: https://docs.openshift.com/container-platform/4.11/openshift_images/create-images.html#use-uid_create-images | ||
RUN chgrp -R 0 ./.npm && \ | ||
andrepestana-aot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
chmod -R g=u ./.npm | ||
|
||
# Entry point | ||
CMD [ "npm", "run", "start:prod:api" ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍