Bajdzis / vscode-database

Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=bajdzis.vscode-database
MIT License
145 stars 82 forks source link

SQL Connection error #63

Open UTexas80 opened 5 years ago

UTexas80 commented 5 years ago

When I attempt to connect to SQL server the following error message is generated: "Connection error! connect ENOENT localhost - connect ECONNREFUSED 127.0.0.1:3306" I entered my valid username & password but was still refused access.

RomanHotsiy commented 5 years ago

I have a similar issue.

Once I launch VS Code I get "Enter password" box (which was not there in version 1.5.3). As I use the empty password for the local db I just press Enter. Connection gets selected and I can select the database from database dropdown which gets populated with actual data. But once I click either of the databases nothing happens: database doesn't get connected.

The issue appears on a new version 2.0.0. When I downgrade to 1.5.3 everything works as expected.

Bajdzis commented 5 years ago

@UTexas80 @RomanGotsiy Please tell me which database server are you trying to connect. MySQL or Postgres ?

RomanHotsiy commented 5 years ago

Postgres in my case. I can make a screencast if that helps

RomanHotsiy commented 5 years ago

@Bajdzis some more info. Hope that helps.

Just after upgrading to 2.0.0 I get the following error on VS Code start:

PostgreSQL Error: error: role "romanhotsiy" does not exist at Connection.parseE (/Users/romanhotsiy/.vscode/extensions/bajdzis.vscode-database-2.0.0/node_modules/pg/lib/connection.js:567:11) at Connection.parseMessage (/Users/romanhotsiy/.vscode/extensions/bajdzis.vscode-database-2.0.0/node_modules/pg/lib/connection.js:391:17) at Socket. (/Users/romanhotsiy/.vscode/extensions/bajdzis.vscode-database-2.0.0/node_modules/pg/lib/connection.js:129:22) at Socket.emit (events.js:182:13) at addChunk (_stream_readable.js:279:12) at readableAddChunk (_stream_readable.js:264:11) at Socket.Readable.push (_stream_readable.js:219:10) at TCP.onread (net.js:636:20)

If I rename user to username (I was looking on changes between 1.5.3 and 2.0.0 and noticed you renamed it but in my saved config it remained as user) in vs code settings database.connections the message disappears.

But, I can't connect to a database. I select one from the dropdown (which gets populated!) but nothing changes.

In dev tools I see the following error:

ERR Cannot read property 'query' of null: TypeError: Cannot read property 'query' of null at queryPromise.Promise (/Users/romanhotsiy/.vscode/extensions/bajdzis.vscode-database-2.0.0/extension/engine/postgresql.js:149:29) at new Promise () at PostgreSQLType.queryPromise (/Users/romanhotsiy/.vscode/extensions/bajdzis.vscode-database-2.0.0/extension/engine/postgresql.js:148:16) at getDatabase.Promise (/Users/romanhotsiy/.vscode/extensions/bajdzis.vscode-database-2.0.0/extension/engine/postgresql.js:179:22) at new Promise () at PostgreSQLType.getDatabase (/Users/romanhotsiy/.vscode/extensions/bajdzis.vscode-database-2.0.0/extension/engine/postgresql.js:177:16) at Manager.getDatabase (/Users/romanhotsiy/.vscode/extensions/bajdzis.vscode-database-2.0.0/extension/Manager.js:126:35) at connectPostgreSQL.execution (/Users/romanhotsiy/.vscode/extensions/bajdzis.vscode-database-2.0.0/extension/action/extension.changeDB.js:9:25) at e._executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:485:959) at e.$executeContributedCommand (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:486:443)

Bajdzis commented 5 years ago

@UTexas80 @RomanGotsiy Thanks for reply. I think the bug is fixed in 2.0.1 version. Could you check if that helped?

UTexas80 commented 5 years ago

MySQL

On Tue, Mar 5, 2019, 12:02 Rafał Budzis notifications@github.com wrote:

@UTexas80 https://github.com/UTexas80 @RomanGotsiy https://github.com/RomanGotsiy Please tell to which database server to connect. MySQL or Postgres ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Bajdzis/vscode-database/issues/63#issuecomment-469763359, or mute the thread https://github.com/notifications/unsubscribe-auth/APWzEYdTDWJGWcChc4ocQHKafZIXJA3oks5vTqMFgaJpZM4bcUF6 .

RomanHotsiy commented 5 years ago

@Bajdzis, So the first issue is fixed. I no longer see the error message.

But the second issue is still here. I can't connect to the database. I see "Database not selected":

db-vscode

Also in VS Code dev tools, I see the following error message: image

Looks like this.connection is null here:

https://github.com/Bajdzis/vscode-database/blob/d653a2f33a845669a570a8edb89d99842f26bb08/extension/engine/postgresql.js#L149

I can try to dig in deeper but I'll have to set up dev env for this. Let me know if you don't have time and want me to try.


I think this is a separate issue so you may want to close this and open a new one.

UTexas80 commented 5 years ago

Still persists. I get the error message "Connection error! connect ECONNREFUSED 127.0.0.1:3306" when I attempt to login to MySQL