question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Looks like TypeORM error message are suppressed.

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Reactions:11
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
basvdijkcommented, Jun 15, 2018

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:

  • Wrong credentials
  • A bug in an entity definition
  • An entity could not be found
  • Something is wrong with a field in an entity
  • Datatype in an entity is not support e.g. 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! 😃

6reactions
zmGitHubcommented, Jun 13, 2019

@jaredmcateer try set:

....
synchronize: false
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to suppress TS6133 error with TypeGraphQL and ...
I am sharing a sample tscongif.json file. With the TypeORM and TypeGraphQL binary, it is comfortable and to meet the desired requirements. You ......
Read more >
Entities - typeorm - GitBook
Entity is a class that maps to a database table (or collection when using MongoDB) ... provides more flexibility on how your database...
Read more >
TypeORM - it's not what you think. : r/typescript - Reddit
Hi,. I'd like to give lots of devs a headsup about how "great" typeorm is, because we've just did a big project and...
Read more >
PostgreSQL and typeorm - Tips, tricks and common issues
Lesson goal. To learn some tips and tricks to solve very common issues with typeorm and postgres database.
Read more >
Complete guide to using TypeORM and TypeScript for data ...
As the name implies, TypeORM is meant to be used with TypeScript. ... We'll create the code for that later, at this stage...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found