Quantcast
Channel: Active questions tagged tekton - Stack Overflow
Viewing all articles
Browse latest Browse all 56

Tekton, npm ci, and "npm ERR! EMFILE: too many open files, open '/root/.npm/_cacache/"

$
0
0

I'm using an incredibly simple pipeline to build my angular App. I run it on an openshift cluster.

these are the two tasks:

  tasks:    - name: fetch-source      params:        - name: url          value: $(params.repo-url)        - name: revision          value: feature/tekton      taskRef:        kind: ClusterTask        name: git-clone      workspaces:        - name: output          workspace: shared-data    - name: build-push      params:        - name: IMAGE          value: $(params.image-reference)        - name: DOCKERFILE          value: $(params.containerfile-path)        - name: CONTEXT          value: $(params.context-dir-path)      runAfter:        - fetch-source      taskRef:        kind: ClusterTask        name: buildah      workspaces:        - name: source          workspace: shared-data

I'm trying to build this container file:

FROM node:latest as builderUSER root# Set the working directoryWORKDIR /usr/local/app# Add the source code to appCOPY ./ /usr/local/app/RUN chown -R root /usr/local/appRUN npm ci# Generate the build of the applicationRUN npm run build# Stage 2: Serve app with nginx serverFROM nginx:latest[...]

The command npm ci fails with the error:

npm ERR! code EMFILEnpm ERR! syscall opennpm ERR! path /root/.npm/_cacache/index-v5/d8/c0/7503a3169361b6a2c8813bf0eddb92eed6417987f616accf18698f2b71f4npm ERR! errno -24npm ERR! EMFILE: too many open files, open '/root/.npm/_cacache/index-v5/d8/c0/7503a3169361b6a2c8813bf0eddb92eed6417987f616accf18698f2b71f4'npm ERR! A complete log of this run can be found in: /root/.npm/_logs/2024-03-27T13_42_33_018Z-debug-0.logsubprocess exited with status 232subprocess exited with status 232Error: building at STEP "RUN npm ci": exit status 232

In my understanding NPM tries to open too many files and hits the ulimit of the container (1024). The Build config that is doing the same operation has not problem and I don't know how that can be possible. I suspect the difference is that the build that is working is executed in a privileged context but i don't know if it's safe to do the same with tekton tasks.

Any idea on were the problem could be?


Viewing all articles
Browse latest Browse all 56

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>