Looks like TypeORM error message are suppressed.
See original GitHub issueI’m submitting a…
[ ] Regression
[ ] Bug report
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
When connecting to the MSql database I get: “Unable to connect to the database. Retrying (1)”
It turned out this was caused by an entity having @Column('description')
which is not allowed and should have beeld @Column()
took hours to figure this out since it looks like there is something wrong with the credentials.
Expected behavior
A more verbose way of error e.g. Unable to connect: host unreachable, or password incorrect etc. Also an option to show the credentials used would be very nice to debug connection issues. Currently I have no clue if the correct credentials are taken from my .env file.
The problem occurred as well when using Entities generated with https://github.com/Kononnable/typeorm-model-generator Apparently there is something wrong with an Entity but the console keeps telling me “Unable to connect to the database. Retrying (1)” instead of giving where something is wrong.
Minimal reproduction of the problem with instructions
Create a DB connection with wrong credentials
What is the motivation / use case for changing the behavior?
Better debugging on connection errors.
Environment
Nest version: 5.0.0
For Tooling issues:
- Node version: 9.9.0
- Platform: Mac
Others:
Issue Analytics
- State:
- Created 5 years ago
- Reactions:11
- Comments:10 (1 by maintainers)
As an addition, for me as a developer it turned out missing this error info is sort of a deal-breaker for NestJS. When developing I saw
[TypeOrmModule] Unable to connect to the database. Retrying (1)...
multiple times. By experience of seeing this message it could be a lot:nvarchar
is used on a Postgres DB`You simply have no clue where to look.
In what way should I be able to see what actually goes wrong? How do you guys debug these errors? Thanks! 😃
@jaredmcateer try set: