mandarineorg / mandarinets

Mandarine.TS is a typescript, decorator-driven framework that allows you to create server-side applications. Mandarine.TS provides a range of built-in solutions such as Dependency Injection, Components, ORM and more. Under its umbrella, Mandarine.TS has 4 modules: Core, Data, Security and MVC, these modules will offer you the requirements to build a Mandarine-powered application.

Home Page:https://www.mandarinets.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Database connection could not be reached

Saverio-Angelicola opened this issue · comments

[Details]
hello, I have a bug when I want to connect with postgresql because after following the doc and putting my database information I receive as an error:
[ERROR | 04/20/2021, 2:39:13 PM] [6320] [PostgresConnector.class] Database connection could not be reached.
However, the information in my database is correct.

[Scenario]
Steps to reproduce the behavior:

  1. I created the mandarin.json file and insert the path to my properties.json file.
    image

  2. I entered this json data in properties.json:
    image

  3. I then used the command: mandarine run --allow-all --watch

[Expected behavior]
Normally I should be able to connect to the DB and be able to use MandarineTS ORM with my DB..

[Screenshots]
image

[OS]
Windows 10 Pro 64 bits

[Environment]

  • Mandarine version: [2.3.2]
  • Deno version [1.9]

This is a tricky one since we are not showing an stacktrace of the error, when we should. I would suspect your postgres has a different authentication method than the ones supported..

@Saverio-Angelicola I will create a branch for this bug with a debug logger for the DB connection, and you could use that branch instead of deno.land/x just to get more information in the meantime. Would that work for you?

Yes, it's good.

@Saverio-Angelicola This is the branch github-283 , this is the mod.ts: https://raw.githubusercontent.com/mandarineorg/mandarinets/github-283/mod.ts

any other file you need from the repo, please use it from there.

In order to enable debug logs, please use DEBUG environment variable.
Ex.

DEBUG=true deno run myscript.ts

Try again, remember to use the flag --reload so Deno fetches the module again @Saverio-Angelicola

It still doesn't work even with the flag --reload.

image

Please try again, sorry for the inconvenience. There was a merge conflict. @Saverio-Angelicola . Remember using --reload

I still have the same bug there are no differences.

image

@Saverio-Angelicola Are you still getting the one with this[msgType] is not a function, or that one went away?

This error is no longer there but restarting the server without the --watch flag I have this error:

image

Ok that's perfect.

cc @Soremwar . @Saverio-Angelicola is getting an unknown auth message code *10. Would you know what this is about? Thanks.

This is postgres version 0.5.0.

@Saverio-Angelicola Further discussion with @Soremwar , seems like authentication method number 10 is not supported but it is in latest versions, I will be submitting a patch version throughout the day and that should solve the issue.

OK thank you for your answer.

@Saverio-Angelicola After further investigation, The latest version of Postgres used by Mandarine is only compatible with Deno 1.9.0, deno 1.9.0 breaks many of our tests (already solved in master branch) but will not be able to create a release since it will be unstable. Best is to way for Mandarine v3.0.0. We apologize for this inconvenience, Mandarine v3.0.0 will be available soon.