0

I'm trying to test local 0x-api. When I do yarn test I dont get any errors. When I do yarn start or yarn db:migrate I got an error: Error: API Key isn't UUID compliant. I've only changed the .env file.

Traceback: /home/roman/0x-api-folder/0x-api/src/config.ts:679 apiKeys.forEach((apiKey) => { ^ Error: API Key isn't UUID compliant at /home/roman/0x-api-folder/0x-api/src/config.ts:682:27 at Array.forEach (<anonymous>) at assertEnvVarType (/home/roman/0x-api-folder/0x-api/src/config.ts:679:21)

2 Answers 2

1

I was having the same errors as well after running:

Yarn install
Yarn build. 

Facing the error as this thread mentioned when trying to execute "yarn db:migrate"

Stack trace:

yarn run v1.22.17
$ ./node_modules/.bin/typeorm migration:run --config ./lib/src/ormconfig.js 
Error during migration run:
Error: API Key  isn't UUID compliant
    at /Users/Documents/0x-api/src/config.ts:751:27
    at Array.forEach (<anonymous>)
    at assertEnvVarType (/Users/Documents/0x-api/src/config.ts:748:21)
    at Object.<anonymous> (/Users/Documents/0x-api/src/config.ts:327:11)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/Documents/0x-api/src/ormconfig.ts:3:1)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps that made it work:

  1. yarn add @0x/[email protected] separately
  2. yarn build
  3. docker-compose up (this starts the local ganache, postgres and redis instances)
  4. Change env variable ETHEREUM_RPC_URL to: localhost:8545 instead of ganache:8545
  5. yarn db:migrate
  6. yarn start
1
  • That worked for me! Thank you SOOOO much! Out of curiosity, what is @0x/neon-router doing? Mar 25, 2022 at 23:26
0

Do you have more of a stack trace available?

Try setting

RFQT_API_KEY_WHITELIST_JSON=[]
PLP_API_KEY_WHITELIST_JSON=[]
1
  • I have set the variables that you recommended. I get the same error. @JacobEvans
    – xKarma
    Sep 9, 2021 at 10:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.