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

Internal server error during quote api call #115

Open
ahmadhuss opened this issue Feb 15, 2023 · 5 comments
Open

Internal server error during quote api call #115

ahmadhuss opened this issue Feb 15, 2023 · 5 comments

Comments

@ahmadhuss
Copy link

ahmadhuss commented Feb 15, 2023

Hi,

There is a problem that I am trying to figure out since 1 day, the APIs are successfully deployed on AWS. But during API calls

GET - https://xxx.execute-api.us-east-1.amazonaws.com/prod/quote

Response:

{
    "message": "Internal server error"
}

It returns an internal server error in response. I followed the steps in the documentation on the custom Ubuntu server which is connected to an AWS account and it deployed successfully.

npm install && npm run build
cdk deploy RoutingAPIStack

hello

This is .env file in the directory.

THROTTLE_PER_FIVE_MINS = '' # Optional
JSON_RPC_PROVIDER_16777 = 'https://testnet-rpc.epeescan.com'
#RPC Providers must be set for the following CHAIN IDs:
MAINNET = 1
ROPSTEN = 3
RINKEBY = 4
KOVAN = 42
OPTIMISM = 10
OPTIMISTIC_KOVAN = 69
ARBITRUM_ONE = 42161
ARBITRUM_RINKEBY = 421611
POLYGON = 137
POLYGON_MUMBAI = 80001
EPE_TESTNET = 16777
TENDERLY_USER = 'xxx212' # For enabling Tenderly simulations
TENDERLY_PROJECT = 'Project' # For enabling Tenderly simulations
TENDERLY_ACCESS_KEY = 'T54-90LtMFjNwz0WpeY0oC31Lalo7atw' # For enabling Tenderly simulations

1.AWS CloudWatch Log Groups:

API-Gateway-Execution-Logs_xxx/prod

(19f10c20-1503-47d2-b4da-c7d9807ac36b) Extended Request Id: AX6lVG4LIAMFxxQ=
(19f10c20-1503-47d2-b4da-c7d9807ac36b) Lambda execution failed with status 200 due to customer function error: Cannot call allow/valid/invalid with undefined. Lambda request id: fa62a267-df63-4d96-b057-5f2ca7312251

2.AWS API Gateway Test:

Routing API

Resource
/quote:

{"message": "Internal server error"}

Wed Feb 15 09:46:41 UTC 2023 : Endpoint response body before transformations: {"errorType":"Error","errorMessage":"Cannot call allow/valid/invalid with undefined","trace":["Error: Cannot call allow/valid/invalid with undefined"," 
at b0e.exports.b0e.exports (/node_modules/@hapi/hoek/lib/error.js:23:19)","  
at null.y0e.exports (/node_modules/@hapi/hoek/lib/assert.js:21:11)","    
at sa.Base._values (/node_modules/@hapi/joi/lib/base.js:992:13)","    
at sa.Base.allow (/node_modules/@hapi/joi/lib/base.js:68:21)","    
at sa.Base.valid (/node_modules/@hapi/joi/lib/base.js:286:26)","    
at Object.<anonymous> (/lib/handlers/quote-to-ratio/schema/quote-to-ratio-schema.ts:24:6)","   
at Module._compile (internal/modules/cjs/loader.js:1085:14)","    
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)","    
at Module.load (internal/modules/cjs/loader.js:950:32)","   
at Function.Module._load (internal/modules/cjs/loader.js:790:12)"]}
Wed Feb 15 09:46:41 UTC 2023 : Lambda execution failed with status 200 due to customer function error: Cannot call allow/valid/invalid with undefined. Lambda request id: ce110fa7-2c6c-4853-b4c4-0f90cf7f8ff3
Wed Feb 15 09:46:41 UTC 2023 : Method completed with status: 502

3.AWS Lamda Function Test:

RoutingAPIStack-RoutingLamb-RoutingLambda2C4DF0900-bOtplPqdwlqV | Routing Lambda

submissioner

I would really appreciate it If someone could help me with this problem.

I want to know what is the main reason for this issue.

aws-cli:
aws-cli/2.9.23 Python/3.9.11 Linux/5.15.0-58-generic exe/x86_64.ubuntu.22 prompt/off

cdk:
2.64.0 (build fb67c77)

The changes on the files are according to the environment variables:

JSON_RPC_PROVIDER_16777 = 'https://testnet-rpc.epeescan.com'
EPE_TESTNET = 16777

screenshot:

commitiment

@pullstacker
Copy link

hi @ahmadhuss did you eventually find the solution? because i got the same problem

@ahmadhuss
Copy link
Author

hi @ahmadhuss did you eventually find the solution? because i got the same problem

Hi, @pullstacker I haven't found any solution to this problem.

@pullstacker
Copy link

pullstacker commented Jan 1, 2024 via email

@ahmadhuss
Copy link
Author

i just solved this issue last night, for me it was because wrong rpc and
chainid variables in .env, perhaps you can double check everything related
to those variables. also ensure your chainid included in smartorderrouter
dependency

On Mon, Jan 1, 2024, 8:31 PM Ahmad Hussnain @.***>
wrote:

hi @ahmadhuss https://github.com/ahmadhuss did you eventually find the
solution? because i got the same problem

Hi, @pullstacker https://github.com/pullstacker I haven't found any
solution to this problem.


Reply to this email directly, view it on GitHub
#115 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/A6THJIHA3FSRQFR3BWK6AN3YMK3DHAVCNFSM6AAAAAAU4UIYDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZTGMZDSNRXHE
.
You are receiving this because you were mentioned.Message ID:
@.***>

Thanks for this information.

@ProtonAnwar
Copy link

Hi,
There is a problem that I am trying to figure out since 1 day, the APIs are successfully deployed on AWS. But during API calls It returns an internal server error in response. I followed the steps in the documentation which is connected to an AWS account and it deployed successfully. Can you help me to understand the aws arn to how to add key value credential in secret manager arn
and also how to rpc add in env.

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

3 participants