Skip to content
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

Problem with Continuous Integration - Error: ENOENT: no such file or directory, open '/root/.aws/config' #467

Open
patrykmakowiak opened this issue Jun 28, 2023 · 0 comments

Comments

@patrykmakowiak
Copy link

I need help setting up continuous integration for Loki. Do you have any ideas? More details below 🔽

CI returns the error ⚠️

Error: ENOENT: no such file or directory, open '/root/.aws/config'
    at Object.openSync (node:fs:600:3)
    at Object.readFileSync (node:fs:468:35)
    at Object.readFileSync (/builds/package-name/js/frontend/operators-apps/storybook/node_modules/aws-sdk/lib/util.js:95:26)
    at parseFile (/builds/package-name/js/frontend/operators-apps/storybook/node_modules/aws-sdk/lib/shared-ini/ini-loader.js:6:38)
    at IniLoader.loadFrom (/builds/package-name/js/frontend/operators-apps/storybook/node_modules/aws-sdk/lib/shared-ini/ini-loader.js:72:25)
    at getRegion (/builds/package-name/js/frontend/operators-apps/storybook/node_modules/aws-sdk/lib/node_loader.js:131:32)
    at Config.region (/builds/package-name/js/frontend/operators-apps/storybook/node_modules/aws-sdk/lib/node_loader.js:186:18)
    at Config.set (/builds/package-name/js/frontend/operators-apps/storybook/node_modules/aws-sdk/lib/config.js:600:39)
    at Config.<anonymous> (/builds/package-name/js/frontend/operators-apps/storybook/node_modules/aws-sdk/lib/config.js:359:12)
    at Config.each (/builds/package-name/js/frontend/operators-apps/storybook/node_modules/aws-sdk/lib/util.js:520:32) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/root/.aws/config'
}

Using docker image sha256:e139f9028786c1b3df3f5afcfc96e3d9e1a8058043437ff9ba16eebd5951cc44 for public.ecr.aws/gitlab/gitlab-runner-helper:x86_64-v15.5.2 with digest public.ecr.aws/gitlab/gitlab-runner-helper@sha256:0fefadbda4528a2bfa229a6594bc8009fa7aa76b0e0841b61172fbc29fb77166 ...

Configuration:

storybook/loki.config.js

module.exports = {
  diffingEngine: "pixelmatch",
  configurations: {
    "chrome.laptop": {
      target: 'chrome.docker',
      width: 1366,
      height: 768,
      deviceScaleFactor: 1,
      mobile: false,
    },
  },
};

package.json (a piece of code)

  "scripts": {
    "loki:test": "loki",
    "loki:approve": "loki approve",
    "loki:ci": "build-storybook && loki test --requireReference --reactUri file:./storybook-static"
  },
  "devDependencies": {
    "loki": "^0.31.1",
  }

I use GitLab gitlab-ci.yml (a piece of code)

test-webapp-visual-regression:
  extends: .with-full-node-modules
  timeout: 30m
  stage: analyze
  script:
    - cd storybook && yarn run loki:ci

It's a strange issue for me, because aws-sdk is dependent on @loki/target-chrome-aws-lambda, but I don't use a Serverless renderer 🤔 (https://loki.js.org/serverless.html)

yarn.lock (a piece of code)

"@loki/target-chrome-aws-lambda@^0.31.0":
  version "0.31.0"
  resolved "https://registry.yarnpkg.com/@loki/target-chrome-aws-lambda/-/target-chrome-aws-lambda-0.31.0.tgz#e36337c9d364066b63a265c02b3f60c37acff836"
  integrity sha512-tkXleRUPX1p8/gJmuWq50rcYyzisvh1lYN1OkHjC40ktb4SnpZS9H7CdKiuCldlPqCdpw1fHAOomNgUvf1/esA==
  dependencies:
    "@loki/core" "^0.31.0"
    aws-sdk "^2.840.0"
    debug "^4.1.1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant