Question

[JDBC Table 1] Cannot connect to specified database: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. (JDBC_00)

  • 11 April 2024
  • 8 replies
  • 69 views

Hi,

I have a JDBC connection for a database that is located in a docker container in my local machine. This connection works perfectly when I make a data collector pipeline.

I installed a transformer engine in a docker container in my local machine (I have installed the external JDBC libraries). Then, I made a very simple pipeline to read from my database using this JDBC connection. I constantly get this error message that “[JDBC Table 1] Cannot connect to specified database: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server. (JDBC_00)”.

Can anyone help me with solving the problem?


8 replies

Hi Atousa,

It is likely your containers you’ve set up are not communicating with each other.

i.e. your new docker container Transformer cannot ‘see’ your mysqldb database container.

Try the suggestion I made on:

 

regarding creating a ‘cluster’ of containers.

i.e. 

Try the following on your pc:

docker network create atousa

docker network connect atousa mysqldb

docker network connect atousa <first-3-chars-of-the-containerid-of-your-transformer>

docker network inspect atousa

 

Russ.

Hi Russ,

Thanks for your response :)

I did as you said. I made a network and added both my containers to it. I still get the same error message when running my pipeline. 

Here, is my connection 

 as you can see it works.

 

Also, my new connection contains my two containers



 

In your connection, the port is usually 3306 ?

(not 3309).

Also, do you have the jdbc driver installed? If not, modify your deployment to add the archive file:

https://streamsets-training.s3.amazonaws.com/externalresources/externalResources.zip

 

Russ.

The port can’t be a problem. When I was making the container I set the port 3309 myself. As you can see the connection works with this port and I have a data collector engine on my laptop (not on a docker container) that works with this set up.
I have already installed the JDBC driver on my engine
 

 

So you have a Data Collector as a tarball (you say not a Docker container?), but the mysqldb is a docker container, right? And you have another container ‘agitated_proskuriakova’? Is that the transformer?

 

I’ll set this up tomorrow and see if I can reproduce. I’ll use the usual root/StreamTra1ningSets! credentials for mysqldb.

I’ll use port 3306.

Can you try setting up an additional Data Collector as a container (so you have all 3 as containers) just to see if that setup works? (don’t forget to add the new docker data collector to your network as per my instructions above).

 

Hi Russ,

That’s true, I have a Data collector tarball, a MySQL database in a docker and a Transformer in a docker. 
thanks:)
I can try with a DC in a docker, too.

Maybe try adding your laptop ipaddress to your network:

docker network connect atousa <your-laptop-ip-address>

 

Perhaps the jdbc driver cannot be reached for the transformer because it is in the data collector.

(So the above command might help)

Whereas when you use the data collector directly, it can.

I have now fixed the problem with the following method
 

 

I did add both mysqldb and Transformer containers to both streamsets-core and streamsets-integrations networks.

For the JDBC sting I used
 jdbc:mysql://mysqldb_for_streamsets:3306/classicmodels

Reply