ERR:节点GYP- GitLab管道突然无法没有任何更改

发布于 2025-02-13 22:20:42 字数 6637 浏览 0 评论 0原文

我正在研究一个项目,并将其推向Gitlab实例。然后管道失败。因此,我正在调查错误的来源并必须确定,这不是我的更改,因为以下情况。

我从一个较旧的提交中重新传播了一条管道(过去成功运行),并且也失败了。与我现在相同的错误。

因此,在我看来,这表明我的更改还没有弄乱。

我们的GitLab跑步者在Kubernetes群集上,管道可与Docker Image(节点:16-Alpine)一起使用。

.gitlab-ci.yml

stages:
  - cli_build_and_analyze
  - some other stages

job_build_and_analyze:
  stage: cli_build_and_analyze
  image: artifacts.company.com/docker-mirror/node:16-alpine
  tags:
    - linux-k8s
  script:
    - export http_proxy="http://proxy.company.com:8080"
    - export https_proxy="http://proxy.company.com:8080"
    - export no_proxy=".company.com"
    - node --version
    - cd cli
    - npm config set registry https://artifacts.company.com/artifactory/api/npm/npm-mirror/
    - npm install
    - npx pkg-fetch -n node16 -p win -a x64
    - yarn build
    - yarn coverage
  artifacts:
    paths:
      - cli/*
    expire_in: 4 h

some other stages: ...

错误

Running with gitlab-runner 14.5.0 (f0a95a76)
  on server-k8s 9-Y7h2DK
Resolving secrets
00:00
Preparing the "kubernetes" executor
00:00
Using Kubernetes namespace: opcerver
Using Kubernetes executor with image artifacts.company.com/docker-mirror/node:16-alpine ...
Using attach strategy to execute scripts...
Preparing environment
00:03
Waiting for pod server/runner-9-y7h2dk-project-1654-concurrent-0bck9f to be running, status is Pending
    ContainersNotInitialized: "containers with incomplete status: [init-permissions]"
    ContainersNotReady: "containers with unready status: [build helper]"
    ContainersNotReady: "containers with unready status: [build helper]"
Running on runner-9-y7h2dk-project-1653-concurrent-0bck9f via gitlab-runner-gitlab-runner-6965989c6b-b6l9x...
Getting source from Git repository
00:01
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/teams/teamname/validation-tool/.git/
Created fresh repository.
Checking out 920d7008 as accept-regex...
Skipping Git submodules setup
Executing "step_script" stage of the job script
01:13
$ export http_proxy="http://proxy.company.com:8080"
$ export https_proxy="http://proxy.company.com:8080"
$ export no_proxy=".company.com"
$ node --version
v16.15.0
$ cd cli
$ npm config set registry https://artifacts.company.com/artifactory/api/npm/npm-mirror/
$ npm install
npm ERR! code 1
npm ERR! path /builds/teams/team/validation-tool/cli/node_modules/bufferutil
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
npm ERR! gyp ERR! stack     at exithandler (node:child_process:406:5)
npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:418:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:478:16)
npm ERR! gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! gyp ERR! System Linux 4.12.14-122.106-default
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /builds/teams/team/validation-tool/cli/node_modules/bufferutil
npm ERR! gyp ERR! node -v v16.15.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-07-06T11_27_26_562Z-debug-0.log
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1

也许由于节点GYP错误而获得依赖项很有帮助:

"devDependencies": {
    "@types/jest": "^27.4.0",
    "@types/node": "^17.0.8",
    "jest": "^27.4.7",
    "ts-jest": "^27.1.2",
    "typescript": "^4.4.4"
},
"dependencies": {
    "commander": "^8.3.0",
    "esbuild": "^0.14.11",
    "node-opcua": "^2.62.7",
    "pkg": "^5.5.1"
}

我删除了每个版本的'^'相同,但仍然存在相同的错误。 (还尝试使用较新的节点版本和其他Docker映像。)

我说它曾经起作用,并且在过去的三周中发生了什么变化,但我不知道是什么。

我从四天开始寻找解决方案,因此每个想法都得到赞赏。谢谢。

I was working on a project and pushed it to organizations gitlab instance. Then the pipeline failed. So I was investigating where the error comes from and had to determine, that it were not my changes because of the following.

I reran a pipeline (which ran successfully in the past) from an older commit and it failed also. The same error as I have now.

So in my point of view this tells that my changes haven't messed anything up.

Our gitlab runners are on a kubernetes cluster and the pipeline works with a docker image (node:16-alpine).

.gitlab-ci.yml

stages:
  - cli_build_and_analyze
  - some other stages

job_build_and_analyze:
  stage: cli_build_and_analyze
  image: artifacts.company.com/docker-mirror/node:16-alpine
  tags:
    - linux-k8s
  script:
    - export http_proxy="http://proxy.company.com:8080"
    - export https_proxy="http://proxy.company.com:8080"
    - export no_proxy=".company.com"
    - node --version
    - cd cli
    - npm config set registry https://artifacts.company.com/artifactory/api/npm/npm-mirror/
    - npm install
    - npx pkg-fetch -n node16 -p win -a x64
    - yarn build
    - yarn coverage
  artifacts:
    paths:
      - cli/*
    expire_in: 4 h

some other stages: ...

error

Running with gitlab-runner 14.5.0 (f0a95a76)
  on server-k8s 9-Y7h2DK
Resolving secrets
00:00
Preparing the "kubernetes" executor
00:00
Using Kubernetes namespace: opcerver
Using Kubernetes executor with image artifacts.company.com/docker-mirror/node:16-alpine ...
Using attach strategy to execute scripts...
Preparing environment
00:03
Waiting for pod server/runner-9-y7h2dk-project-1654-concurrent-0bck9f to be running, status is Pending
    ContainersNotInitialized: "containers with incomplete status: [init-permissions]"
    ContainersNotReady: "containers with unready status: [build helper]"
    ContainersNotReady: "containers with unready status: [build helper]"
Running on runner-9-y7h2dk-project-1653-concurrent-0bck9f via gitlab-runner-gitlab-runner-6965989c6b-b6l9x...
Getting source from Git repository
00:01
Fetching changes with git depth set to 50...
Initialized empty Git repository in /builds/teams/teamname/validation-tool/.git/
Created fresh repository.
Checking out 920d7008 as accept-regex...
Skipping Git submodules setup
Executing "step_script" stage of the job script
01:13
$ export http_proxy="http://proxy.company.com:8080"
$ export https_proxy="http://proxy.company.com:8080"
$ export no_proxy=".company.com"
$ node --version
v16.15.0
$ cd cli
$ npm config set registry https://artifacts.company.com/artifactory/api/npm/npm-mirror/
$ npm install
npm ERR! code 1
npm ERR! path /builds/teams/team/validation-tool/cli/node_modules/bufferutil
npm ERR! command failed
npm ERR! command sh -c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:202:16)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:294:16)
npm ERR! gyp ERR! stack     at exithandler (node:child_process:406:5)
npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:418:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:478:16)
npm ERR! gyp ERR! stack     at processTicksAndRejections (node:internal/process/task_queues:83:21)
npm ERR! gyp ERR! System Linux 4.12.14-122.106-default
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /builds/teams/team/validation-tool/cli/node_modules/bufferutil
npm ERR! gyp ERR! node -v v16.15.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-07-06T11_27_26_562Z-debug-0.log
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1

Maybe it's helpful to have the dependencies because of the node-gyp error:

"devDependencies": {
    "@types/jest": "^27.4.0",
    "@types/node": "^17.0.8",
    "jest": "^27.4.7",
    "ts-jest": "^27.1.2",
    "typescript": "^4.4.4"
},
"dependencies": {
    "commander": "^8.3.0",
    "esbuild": "^0.14.11",
    "node-opcua": "^2.62.7",
    "pkg": "^5.5.1"
}

I removed the '^' of every version to ensure it's the exact same and still the same error. (Also tried it with newer node version and other docker images.)

How I said it once worked and in the last three weeks something has changed but I don't know what.

I'm searching for a solution since four days so every idea is appreciated. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无尽的现实 2025-02-20 22:20:42

好的,我自己想出了。

我们的镜子里必须弄乱一些东西。如果我采用了原始节点:16高山就可以了!

NVM ... :)

Alright figured it out by myself.

Something must be messed up in our mirror. If I took the origin node:16-alpine it worked!

nvm... :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文