CircleCI:构建 Meteor 2.2 docker 应用程序 - 失败

Posted

技术标签:

【中文标题】CircleCI:构建 Meteor 2.2 docker 应用程序 - 失败【英文标题】:CircleCI: build of Meteor 2.2 docker application - failing 【发布时间】:2021-08-02 22:25:11 【问题描述】:

如何得到这个错误?

我使用 Meteor 2.2 和 Node 12.16.1 和 CircleCI 编译器 @ version: 2.1 和最新的 docker 映像。

对于一个基地,我使用的是定制的 docker "meteor-launchpad"

我决定将 Meteor 从 1.11.1 升级到 2.2

脚本中的命令发生故障:

meteor build --directory "$APP_BUNDLE_DIR" --server-only

“$APP_BUNDLE_DIR”在“meteor-launchpad”镜像创建期间设置(已经在镜像中设置):

ENV APP_BUNDLE_DIR /opt/meteor/dist

此错误在 1.11.1 Meteor 版本中不存在(现在也不存在)

在使用 Ubuntu 20 在我的本地服务器上创建映像期间,此错误存在

我开发了自定义启动板并添加了一种使用任何 Meteor 版本的方法。效果是在 Meteor 1.11.1 上可以在 CircleCI 上创建图像。

系统(基础映像)上使用了非特殊用户。它是标准的:root@debian:jessie

对于节点:用户节点是用组节点创建的:

RUN groupadd -r node && useradd -m -g node node

我已尝试为用户授予某些组的访问权限,但没有效果:

RUN usermod -aG staff node
RUN usermod -aG node root

在启动板中设置 Meteor 的标志:METEOR_ALLOW_SUPERUSER=true

我不知道在哪里可以找到更多信息来解决这个问题。任何想法如何解决该错误?它说PERM错误,这表明存在一些权限问题,但安装由root用户处理。我需要为 CircleCI 设置任何环境值吗?

CircleCI (2.1) 使用 Meteor (2.2) 的详细错误:

[-] Building Meteor application...


Even with METEOR_ALLOW_SUPERUSER or --allow-superuser, permissions in your app
directory will be incorrect if you ever attempt to perform any Meteor tasks as
a normal user. If you need to fix your permissions, run the following command
from the **** of your project:

  sudo chown -Rh <username> .meteor/local

/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:218
      throw error;
      ^

Error: EPERM: operation not permitted, copyfile '/tmp/mt-1kbgw6u.nlqy/plugin.npm-check.os/npm/node_modules/meteor/babel-compiler/node_modules/resolve/.editorconfig' -> '/tmp/mt-1kbgw6u.nlqy/plugin.npm-check.os/npm/node_modules/meteor/babel-compiler/node_modules/.temp-ttjf6y.m2q6h/node_modules/resolve/.editorconfig'
    at Object.copyFileSync (fs.js:1907:3)
    at /****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1642:23
    at copyFile (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:1697:3)
    at Object.cp_r (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/fs/tools/fs/files.ts:549:5)
    at /tools/isobuild/meteor-npm.js:429:11
    at Array.forEach (<anonymous>)
    at copyNpmPackageWithSymlinkedNodeModules (/tools/isobuild/meteor-npm.js:422:29)
    at /tools/isobuild/meteor-npm.js:358:7
    at Array.forEach (<anonymous>)
    at Object.rebuildIfNonPortable (/tools/isobuild/meteor-npm.js:345:27)
    at /tools/isobuild/bundler.js:428:19
    at Function._.each._.forEach (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:191:9)
    at Function.readDirsFromJSON (/tools/isobuild/bundler.js:427:9)
    at /tools/isobuild/bundler.js:2573:34
    at Function._.each._.forEach (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:186:9)
    at Function.readFromDisk (/tools/isobuild/bundler.js:2565:7)
    at Object.readJsImage (/tools/isobuild/bundler.js:3568:18)
    at /tools/isobuild/isopack.js:897:28
    at Function._.each._.forEach (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:186:9)
    at Isopack._loadUnibuildsFromPath (/tools/isobuild/isopack.js:894:7)
    at /tools/packaging/tropohouse.js:521:21
    at Function._.each._.forEach (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:186:9)
    at /tools/packaging/tropohouse.js:520:13
    at Object.enterJob (/tools/utils/buildmessage.js:388:12)
    at /tools/packaging/tropohouse.js:515:22
    at Object.enterJob (/tools/utils/buildmessage.js:388:12)
    at Object.download (/tools/packaging/tropohouse.js:427:20)
    at /tools/packaging/tropohouse.js:613:18
    at /tools/utils/buildmessage.js:609:21
    at /****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/fiber_pool.js:43:40
 => awaited here:
    at Promise.await (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:60:12)
    at Object.forkJoin (/tools/utils/buildmessage.js:641:6)
    at exports.Tropohouse.downloadPackagesMissingFromMap (/tools/packaging/tropohouse.js:609:18)
    at /tools/project-context.js:857:25
    at Object.enterJob (/tools/utils/buildmessage.js:388:12)
    at /tools/project-context.js:856:20
    at /tools/packaging/catalog/catalog.js:100:5
    at Object.capture (/tools/utils/buildmessage.js:283:5)
    at Object.catalog.runAndRetryWithRefreshIfHelpful (/tools/packaging/catalog/catalog.js:99:31)
    at ProjectContext._downloadMissingPackages (/tools/project-context.js:855:13)
    at /tools/project-context.js:300:9
    at Object.enterJob (/tools/utils/buildmessage.js:388:12)
    at ProjectContext._completeStagesThrough (/tools/project-context.js:290:18)
    at /tools/project-context.js:282:12
    at Function.run (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/tool-env/tools/tool-env/profile.ts:289:14)
    at ProjectContext.prepareProjectForBuild (/tools/project-context.js:281:13)
    at /tools/cli/commands.js:1010:20
    at Object.capture (/tools/utils/buildmessage.js:283:5)
    at Object.main.captureAndExit (/tools/cli/main.js:275:29)
    at buildCommand (/tools/cli/commands.js:1007:8)
    at /tools/cli/commands.js:948:25
    at Function.run (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/tools/tool-env/tools/tool-env/profile.ts:289:14)
    at /tools/cli/commands.js:946:18
    at /****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/fiber_pool.js:43:40
 => awaited here:
    at Promise.await (/****/.meteor/packages/meteor-tool/.2.2.0.1j8auib.qcbe++os.linux.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.linux.x86_64/dev_bundle/lib/node_modules/meteor-promise/promise_server.js:60:12)
    at /tools/cli/main.js:1529:7 
  errno: -1,
  syscall: 'copyfile',
  code: 'EPERM',
  path: '/tmp/mt-1kbgw6u.nlqy/plugin.npm-check.os/npm/node_modules/meteor/babel-compiler/node_modules/resolve/.editorconfig',
  dest: '/tmp/mt-1kbgw6u.nlqy/plugin.npm-check.os/npm/node_modules/meteor/babel-compiler/node_modules/.temp-ttjf6y.m2q6h/node_modules/resolve/.editorconfig'

【问题讨论】:

您是否已经尝试过错误上方建议的命令? 是的,基本上它什么都不做(测试用户:root) 【参考方案1】:

CircleCI 为 CircleCI 的默认 Docker 17.09.0-ceNodeJS &gt; 14.9.0 的 NodeJS 执行器之间的特定不兼容记录了一个特定解决方案:

https://support.circleci.com/hc/en-us/articles/360050934711

如果在您的 CircleCI 配置中使用 setup_remote_docker 键,则像这样设置 Docker 版本可以解决问题:

      - setup_remote_docker:
          version: 19.03.13

【讨论】:

以上是关于CircleCI:构建 Meteor 2.2 docker 应用程序 - 失败的主要内容,如果未能解决你的问题,请参考以下文章

CircleCI 2.0 Android 构建总是失败

sh 使用CCMenu轮询CircleCI构建状态。

GitHub + circleCI 自动构建/自动部署 应用

GitHub + circleCI 自动构建/自动部署 应用

Meteor build 在部署到 Heroku 时中断

Docker:尝试使用本地 CircleCI 构建连接到 Docker 守护程序时权限被拒绝