简体   繁体   中英

'Handshake inactivity timeout' using TypeOrm and AWS RDS Aurora MySQL instance

Trying to connect to AWS RDS Aurora DB MySQL using TypeOrm and it gives me Handshake inactivity timeout error.

code: 'PROTOCOL_SEQUENCE_TIMEOUT',
fatal: true,
timeout: 10000

Tried using default 10sec and my own 15sec timeout.

ormconfig.json file:

{
    "type": "mysql",
    "host": "host connection string",
    "port": 3306,
    "username": "xxxx",
    "password": "xxxx",
    "database": "xxxx",
    "synchronize": true,
    "logging": true,
    "connectTimeout": 15000,
    "entities": [
       "src/entity/**/*.ts"
    ],
    "migrations": [
       "src/migration/**/*.ts"
    ],
    "subscribers": [
       "src/subscriber/**/*.ts"
    ],
    "cli": {
       "entitiesDir": "src/entity",
       "migrationsDir": "src/migration",
       "subscribersDir": "src/subscriber"
    }
}

Able to connect to the instance using Linux MySQL client CLI and even tried connecting to the databse using ECS in same VPC but got same error.

The most common course of this problem - is wrong settings of your vpc and security group rules. Try to write in/out bound rules for it.

Useful links: * https://docs.aws.amazon.com/en_us/vpc/latest/userguide/VPC_SecurityGroups.html#DefaultSecurityGroup * https://docs.aws.amazon.com/en_us/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-security-group-ingress.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM