V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
gadfly3173
V2EX  ›  GitLab

在 gitlab-runner 中进行 electron 应用打包时发生 RequestError: socket hang up

  •  
  •   gadfly3173 · 164 天前 · 529 次点击
    这是一个创建于 164 天前的主题,其中的信息可能已经有所发展或是发生改变。

    docker 部署的 gitlab/gitlab-ce:14.8.1-ce.0 、gitlab/gitlab-runner:ubuntu-v14.8.0 ,docker-compose.yml 如下

     version: '2'
     services:
         gitlab:
           image: 'gitlab/gitlab-ce:14.8.1-ce.0'
           container_name: "gitlab"
           restart: unless-stopped
           hostname: 'docker-gitlab-01'
           environment:
             TZ: 'Asia/Shanghai'
             # 这里的配置其实就是 /etc/gitlab/gitlab.rb 中的配置,按自己的实际需求增减
             GITLAB_OMNIBUS_CONFIG: |
               external_url 'xxx'
               gitlab_rails['time_zone'] = 'Asia/Shanghai'
               prometheus['enable'] = false
               gitlab_rails['gitlab_shell_ssh_port'] = xxx
               nginx['listen_port'] = 80
               nginx['listen_https'] = false
           ports:
             - 'xxx:80'
             - 'xxx:22'
           volumes:
             - /opt/gitlab/config:/etc/gitlab
             - /opt/gitlab/data:/var/opt/gitlab
             - /opt/gitlab/logs:/var/log/gitlab
           networks:
             - gitlab
     
         gitlab-runner:
           image: gitlab/gitlab-runner:ubuntu-v14.8.0
           container_name: "gitlab-runner"
           restart: unless-stopped
           depends_on:
             - gitlab
           volumes:
             - ./opt/gitlab-runner:/etc/gitlab-runner
             - /var/run/docker.sock:/var/run/docker.sock
             - ./gitlab-runner:/home/gitlab-runner
           networks:
             - gitlab
     
     networks:
         gitlab:
    

    目录挂载网上抄的,有点乱。gitlab-runner 为 docker 模式,gitlab-ci.yml 如下:

    stages:
      - build
    
    build:
      # image: electronuserland/builder:14-wine-01.22
      image: node:16.14.0-alpine3.14
      stage: build
      script:
        - node -v
        - npm -v
        - yarn
        - yarn electron:build
      artifacts:
        expire_in: 30 days
        paths:
          - ./dist_electron/
      only:
        - release
      tags:
        - default
    

    现在在执行 yarn ,进入 [4/4] Building fresh packages... 后,就会弹出如下失败日志:

    [4/4] Building fresh packages...
    error /builds/xxxxxx/node_modules/electron: Command failed.
    Exit code: 1
    Command: node install.js
    Arguments: 
    Directory: /builds/xxxxxxxxxx/node_modules/electron
    Output:
    RequestError: socket hang up
        at ClientRequest.<anonymous> (/builds/xxxxxxx/node_modules/got/source/request-as-event-emitter.js:178:14)
        at Object.onceWrapper (node:events:640:26)
        at ClientRequest.emit (node:events:532:35)
        at ClientRequest.origin.emit (/builds/xxxxxxxxx/node_modules/@szmarczak/http-timer/source/index.js:37:11)
        at TLSSocket.socketOnEnd (node:_http_client:466:9)
        at TLSSocket.emit (node:events:532:35)
        at endReadableNT (node:internal/streams/readable:1346:12)
        at processTicksAndRejections (node:internal/process/task_queues:83:21)
    info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
    ERROR: Job failed: exit code 1
    

    项目使用@vue/[email protected][email protected][email protected]构建 尝试在 gitlab-runner 的 docker 中和服务器上直接执行都没有失败,求大佬们看看可以怎么排查问题。

    目前尚无回复
    关于   ·   帮助文档   ·   API   ·   FAQ   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   3194 人在线   最高记录 5497   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 04:53 · PVG 12:53 · LAX 21:53 · JFK 00:53
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.