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.

More verbose message instead of "Unable to connect to the database" when something is wrong

See original GitHub issue

Issue type:

[X] question [X] bug report [ ] feature request [ ] documentation issue

Database system/driver:

[ ] cordova [ ] mongodb [x] mssql [ ] mysql / mariadb [ ] oracle [ ] postgres [ ] sqlite [ ] sqljs [ ] react-native

TypeORM version:

[ ] latest [ ] @next [x] 0.2.7 (or put your version here)

Steps to reproduce or a small repository showing the problem:

I’ve created a project with https://github.com/nestjs/nest Now when something is wrong with a credential or when I have an error in my entity file I got the error ‘Unable to connect to the database.’ instead of an error pointing to what is really wrong e.g. wrong credential, error in relationship between entities etc.

My suggestion is to make this more verbose so you know what is wrong. Now I literally have no clue where to look beside I know it has something to do with a many-to-one relationship

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

23reactions
ferdiebirdiecommented, Jun 27, 2019

I also have the same problem. With npm run start it’s works fine for me, but with npm run start:dev i have error https://prnt.sc/o3l5dp.

I found my solution from this link. In your configuration, try changing src to dist:

"entities": ["dist/**/*.entity.js"]

2reactions
silent528commented, Sep 29, 2019

我也有同样的问题。使用npm run start对我来说很好,但是使用npm run start:dev我有错误https://prnt.sc/o3l5dp。

我从此链接找到了解决方案。在您的配置中,尝试将src更改为dist:

"entities": ["dist/**/*.entity.js"]

thank you! it’s running

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error message when you connect to an instance of SQL Server
Describes that you may receive an error message when you connect to an instance of SQL Server without specifying a login database.
Read more >
Troubleshooting Error 18456 - SQLBlog.org
I think we've all dealt with error 18456, whether it be an application unable to access SQL Server, credentials changing over time, ...
Read more >
How To Debug the WordPress "Error Establishing Database ...
A good first step for debugging this problem is to try logging into the server to see if the system is healthy and...
Read more >
How to fix common problems with MySQL databases - UpCloud
If you are greeted with “Welcome to the MySQL/MariaDB monitor” the connection was successful and the database service is running. If instead, you...
Read more >
How To Fix The "Error Establishing a Database Connection" in ...
The “error establishing a database connection” is probably one of the most common errors WordPress users can encounter. It's closely tied to ...
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