This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 148197 - Connection can't be established because of too many errors
Summary: Connection can't be established because of too many errors
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: MySQL (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: David Vancouvering
URL:
Keywords: REGRESSION
Depends on:
Blocks:
 
Reported: 2008-09-24 12:43 UTC by Roman Mostyka
Modified: 2008-10-06 10:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot of error message. (30.29 KB, image/png)
2008-09-24 12:43 UTC, Roman Mostyka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-09-24 12:43:13 UTC
1. Connect to MySQL server.
2. Expand server node, rightclick some DB and choose "Connect".

Result: Connection node is added, but connection can't be established with error message about too many errors. Look at
screenshot for full message. By the way, I was able to connect to MySQL server itself.
I reproduced this on Mac OS X.
Comment 1 Roman Mostyka 2008-09-24 12:43:44 UTC
Created attachment 70437 [details]
Screenshot of error message.
Comment 2 David Vancouvering 2008-09-24 19:46:27 UTC
I can't reproduce.  It looks like MySQL has blocked any new connections because there were too many connection errors
from that host - likely caused by a flaky network.  The error you provide suggests running mysqladmin flush-hosts?

If you can reproduce consistently even after flush-hosts, please specify exactly how you reproduce.  I am pretty sure
this is an issue specific to your environment.
Comment 3 Roman Mostyka 2008-09-25 09:22:13 UTC
I can reproduce this issue constantly, but everything was fine before. So it is a regression.
Try easier steps:

1. Add MySQL server.
2. Connect to it.
3. Rightclick server's node and choose "Delete".
4. Add MySQL server and try to connect to it.

Result: Error message appears. After flush-hosts everything starts to work fine, but only until next delete/add server
cycle.
Comment 4 Roman Mostyka 2008-09-25 09:50:43 UTC
If this issue is rarely reproducible (only for me, for example), then I don't mind to remove fix-in-65 status whiteboard.
Comment 5 David Vancouvering 2008-09-25 22:54:09 UTC
Works fine for me on Mac.  I'll try on XP.
Comment 6 David Vancouvering 2008-09-25 22:55:51 UTC
Works fine for me on XP too.  I suspect there's something messed up with your MySQL server in that there are two issues
that are only happening to you.

Please try rebooting your machine and see if that helps.
Comment 7 Roman Mostyka 2008-09-26 11:09:07 UTC
Actually issue about stopping MySQL is reproducible on Windows XP with local standalone MySQL server, but this issue is
reproducible on Mac OS X with remote standalone MySQL installed on Solaris. And main point that everything was fine
before with this bundle.
And I'm constantly able to reproduce this issue, with reboot too. So if it helps, we can try to setup VNC session.
Comment 8 David Vancouvering 2008-10-01 18:43:21 UTC
Hi, Andrei, can you please look at this, I can't reproduce and Roman and I have very little time to collaborate.  

Many thanks!

David
Comment 9 Andrei Badea 2008-10-02 11:21:08 UTC
I can reproduce the issue with rave-opteron.
Comment 10 Andrei Badea 2008-10-02 12:27:07 UTC
The cause of the problem seems to be the MySQLDatabaseServer.checkRunning() method. It uses a socket to connect to and
immediately disconnect from the server, so the handshake at the MySQL protocol level that the JDBC driver normally
performs doesn't take place, and the server considers the connection attempt an error.

Perhaps a way to fix this would be to use the JDBC driver instead of a socket, and use the socketTimeout property. But
this looks like a major change, and I think David, as the module owner, should make the call.
Comment 11 David Vancouvering 2008-10-02 18:29:22 UTC
Thanks for reproducing and figuring this out.  If someone can point me to a MySQL server that reproduces this error I
would much appreciate it.
Comment 13 David Vancouvering 2008-10-04 12:42:33 UTC
e18773e6403d

Redid how we check for aliveness of the server, by using Andrei's suggestion of
just opening a connection.

Also, reduced assumptions about whether the server is "up" or "down."  All we
really know for sure is we are connected or not connected.  Thus Start and Stop
are always enabled, and Connect is always enabled except when you're connected
already.

Also should be handling error conditions like bad port better now - please test
and let me know.

I am running a fetch/merge/build/test cycle now, should be able to push in the
morning (well, later in the morning :))
Comment 14 Quality Engineering 2008-10-05 05:17:11 UTC
Integrated into 'main-golden', will be available in build *200810050201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/e18773e6403d
User: David Van Couvering <davidvc@netbeans.org>
Log: #148753: Can't start MySQL server from Netbeans in the latest build
#149150: [65cat] cannot click the submenu properties on server due to error dialog box
#148197: Connection can't be established because of too many errors
Comment 15 Roman Mostyka 2008-10-06 10:27:11 UTC
Verified with build 081005.
Thanks Andrei and David that spent time on this issue. I knew that my magic machine is really magic, not lying. :)