NotionX / react-notion-x

Fast and accurate React renderer for Notion. TS batteries included. ⚡️
https://react-notion-x-demo.transitivebullsh.it
MIT License
4.87k stars 570 forks source link

Error: getaddrinfo EAI_AGAIN null - GitHub Actions #257

Closed Vadorequest closed 2 years ago

Vadorequest commented 2 years ago

I'm getting the following error during the GHA build, I believe it to be related to my Redis configuration.

Maybe I got something wrong? Any idea what could be the cause? I don't see any error locally. 👉 My main guess is that the .env file isn't available on GHA, which makes it fail to connect to Redis.

Here is my .env config:

REDIS_HOST=redis-16XXX.c78.eu-west-1-2.ec2.cloud.redislabs.com:16XXX
REDIS_PASSWORD=XXX
REDIS_USER='default'

Here are the logs

yarn run v1.22.17
$ next build
warn  - No build cache found. Please configure build caching for faster rebuilds. Read more: https://nextjs.org/docs/messages/no-cache
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
https://nextjs.org/telemetry

info  - Checking validity of types...
warn  - The Next.js plugin was not detected in your ESLint configuration. See https://nextjs.org/docs/basic-features/eslint#migrating-existing-config
info  - Creating an optimized production build...
info  - Compiled successfully
info  - Collecting page data...
(node:1960) [DEP0128] DeprecationWarning: Invalid 'main' field in '/home/runner/work/portfolio/portfolio/node_modules/react-icons/package.json' of 'lib'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
Using redis? true
node:events:498
      throw er; // Unhandled 'error' event
      ^

Error: getaddrinfo EAI_AGAIN null
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)
Emitted 'error' event on Keyv instance at:
    at KeyvRedis.<anonymous> (/home/runner/work/portfolio/portfolio/node_modules/keyv/src/index.js:49:46)
    at KeyvRedis.emit (node:events:[5](https://github.com/Vadorequest/portfolio/runs/5808060660?check_suite_focus=true#step:5:5)20:28)
    at Redis.<anonymous> (/home/runner/work/portfolio/portfolio/node_modules/@keyv/redis/src/index.js:1[6](https://github.com/Vadorequest/portfolio/runs/5808060660?check_suite_focus=true#step:5:6):40)
    at Redis.emit (node:events:520:28)
    at Redis.silentEmit (/home/runner/work/portfolio/portfolio/node_modules/ioredis/built/redis/index.js:553:26)
    at Socket.<anonymous> (/home/runner/work/portfolio/portfolio/node_modules/ioredis/built/redis/event_handler.js:191:14)
    at Object.onceWrapper (node:events:640:26)
    at Socket.emit (node:events:532:35)
    at emitErrorNT (node:internal/streams/destroy:15[7](https://github.com/Vadorequest/portfolio/runs/5808060660?check_suite_focus=true#step:5:7):[8](https://github.com/Vadorequest/portfolio/runs/5808060660?check_suite_focus=true#step:5:8))
    at emitErrorCloseNT (node:internal/streams/destroy:[12](https://github.com/Vadorequest/portfolio/runs/5808060660?check_suite_focus=true#step:5:12)2:3) {
  errno: -[30](https://github.com/Vadorequest/portfolio/runs/5808060660?check_suite_focus=true#step:5:30)01,
  code: 'EAI_AGAIN',
  syscall: 'getaddrinfo',
  hostname: 'null'
}
transitive-bullshit commented 2 years ago

This has nothing to do with react-notion-x.

Please only open issues on the correct repo (in this case nextjs-notion-starter-kit).

If you want to use redis with github actions over there, then follow what I'm doing on my personal branch: https://github.com/transitive-bullshit/nextjs-notion-starter-kit/blob/transitive-bullshit/.github/workflows/build.yml#L17-L21

You'll also need to add these environment variables to your github repository as secrets. You can google how to do this (the github docs are great).

Vadorequest commented 2 years ago

Thanks, and yeah sorry I didn't notice I was not in the right repo, I thought I had opened it there!