Helpme: error starting Blynk server. stopping

I’ gonna install Blynk localserver on my Ubuntu 18.04 LTS, the error starting Blynk server. stopping appears when i excuted jar file. Please help me fix it:


The log file:

Blockquote09:40:25.489 INFO - Using data dir ‘/home/prod/Blynk’
09:40:25.518 INFO - Region : local. Host : 127.0.1.1.
09:40:25.575 INFO - Using native epoll transport.
09:40:26.296 INFO - Initializing gmail smtp mail transport. Username : example@gmail.com. SMTP host : smtp.gmail.com:587
09:40:26.457 INFO - Reports : 0
09:40:26.458 INFO - Didn’t find custom user certificates.
09:40:26.459 INFO - Didn’t find Let’s Encrypt certificates.
09:40:26.459 WARN - You didn’t specified ‘server.host’ or ‘contact.email’ properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
09:40:26.459 INFO - Using native openSSL provider.
09:40:26.459 WARN - ATTENTION. Server certificate paths (cert : ‘/home/prod’, key : ‘/home/prod’) not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
09:40:27.393 ERROR- Error initializing HTTP API and WebSockets, port 8080
io.netty.channel.unix.Errors$NativeIoException: bind(…) failed: Address already in use
09:40:28.242 INFO - Using data dir ‘/home/prod/Blynk’
09:40:28.269 INFO - Region : local. Host : 127.0.1.1.
09:40:28.285 INFO - Using native epoll transport.
09:40:28.551 INFO - Initializing gmail smtp mail transport. Username : example@gmail. SMTP host : smtp.gmail:587
09:40:28.706 INFO - Reports : 0
09:40:28.706 INFO - Didn’t find custom user certificates.
09:40:28.707 INFO - Didn’t find Let’s Encrypt certificates.
09:40:28.707 WARN - You didn’t specified ‘server.host’ or ‘contact.email’ properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
09:40:28.707 INFO - Using native openSSL provider.
09:40:28.707 WARN - ATTENTION. Server certificate paths (cert : ‘/home/prod’, key : ‘/home/prod’) not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
09:40:29.295 ERROR- Error initializing HTTP API and WebSockets, port 8080
io.netty.channel.unix.Errors$NativeIoException: bind(…) failed: Address already in use
09:59:46.552 INFO - Using data dir ‘/home/prod/Blynk’
09:59:46.585 INFO - Region : local. Host : 127.0.1.1.
09:59:46.602 INFO - Using native epoll transport.
09:59:46.939 INFO - Initializing gmail smtp mail transport. Username : xxxx. SMTP host : xxxx
09:59:47.091 INFO - Reports : 0
09:59:47.091 INFO - Didn’t find custom user certificates.
09:59:47.092 INFO - Didn’t find Let’s Encrypt certificates.
09:59:47.092 WARN - You didn’t specified ‘server.host’ or ‘contact.email’ properties in server.properties file. Automatic certificate generation is turned off. Please specify above properties for automatic certificates retrieval.
09:59:47.092 INFO - Using native openSSL provider.
09:59:47.092 WARN - ATTENTION. Server certificate paths (cert : ‘/home/prod’, key : ‘/home/prod’) not valid. Using embedded server certs and one way ssl. This is not secure. Please replace it with your own certs.
09:59:47.610 ERROR- Error initializing HTTP API and WebSockets, port 8080
io.netty.channel.unix.Errors$NativeIoException: bind(…) failed: Address already in use

1 Like

Please carefully read this instruction about installing / setting up local Blynk Server:

You have many issues, but the most severe is 1.

  1. ERROR: Address already in use. This means your 8080 port, necessary for local Blynk Server Hardware connection, has been used / allocated for another purpose. Only you can check and know why.
  2. You didn’t provide your own mail credentials for email notification system. But this is OK if you don’t really need it.
 mail.smtp.auth=true
 mail.smtp.starttls.enable=true
 mail.smtp.host=smtp.gmail.com
 mail.smtp.port=587
 mail.smtp.username=YOUR_EMAIL_HERE
 mail.smtp.password=YOUR_EMAIL_PASS_HERE
  1. You haven’t set up SSL/TLS certificates (either from Let’s Encrypt or OpenSSL). Still this is OK if you don’t need your server very secured.
  2. You’re running OpenJDK version 11, therefore you must use Blynk server written for Java 11 and up:

https://github.com/blynkkk/blynk-server/releases/download/v0.41.11/server-0.41.11.jar

not the one written for Java 8

https://github.com/blynkkk/blynk-server/releases/download/v0.41.11/server-0.41.11-java8.jar

1 Like

Thank for you reply, Khôi.
(Anh có thể xem tin nhắn riêng được ko?)

Blockquote ERROR: Address already in use` . This means your 8080 port, necessary for local Blynk Server Hardware connection, has been used / allocated for another purpose. Only you can check and know why.<

  1. Port 8080 is running for Tomcat Server, This Server runs for Production Application, so, maybe issue here.

BlockquoteYou didn’t provide your own mail credentials for email notification system. But this is OK if you don’t really need it.
mail.smtp.auth=true
mail.smtp.starttls.enable=true
mail.smtp.host=smtp.gmail.com
mail.smtp.port=587
mail.smtp.username=YOUR_EMAIL_HERE
mail.smtp.password=YOUR_EMAIL_PASS_HERE

  1. I’m a newbie, therefor i unable insert 2 links in this thread, so, i changed some link to text and for security also

BlockquoteYou haven’t set up SSL/TLS certificates (either from Let’s Encrypt or OpenSSL). Still this is OK if you don’t need your server very secured.

  1. This server builded for Local, so i dont need it

Blockquoteu’re running OpenJDK version 11, therefore you must use Blynk server written for Java 11 and up:
https://github.com/blynkkk/blynk-server/releases/download/v0.41.11/server-0.41.11.jar

not the one written for Java 8

https://github.com/blynkkk/blynk-server/releases/download/v0.41.11/server-0.41.11-java8.jar

  1. Sorry for this mistake, i’ve tried with java server-0.41.11.jar but it was failed, so i am trying with jar java8.

So, probably we should focus to #1 issue. Could you share me how, i am newbie in this field.

Regards,

The easiest way is to change Tomcat default port 8080 to port 80 (provided port 80 is not currently used by some program).
To do it:

  1. Locate server.xml in {Tomcat installation folder}\conf\ diectory
  2. Replace any instance of 8080 with 80 in server.xml

For example from original :

 <!-- Define a non-SSL HTTP/1.1 Connector on port 8180 -->
    <Connector port="8080" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" />

or

 <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8080" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />

to:

 <!-- Define a non-SSL HTTP/1.1 Connector on port 8180 -->
    <Connector port="80" maxHttpHeaderSize="8192"
               maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
               enableLookups="false" redirectPort="8443" acceptCount="100"
               connectionTimeout="20000" disableUploadTimeout="true" />

or

 <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL HTTP/1.1 Connector on port 8080
    -->
    <Connector port="80" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
  1. Save server.xml file. Restart Tomcat or whole system.

There is another more complicated way to keep Tomcat @ port 8080 and change Local Blynk hardware Server port 8080 to another one. But this way is just for your secret local server as other people won’t know which port to connect, and is not advisable.

Good luck.

That ok by changing default port to other in Bylnk server.properties file.
It’s worked.

Thank you so much!

Hello,

have similar problem and I am looking for any help to start the Blynk local server on:

Linux Debian
4.19.0-9-amd64 #1 SMP Debian 4.19.118-2+deb10u1 (2020-06-07)
Java
openjdk version “11.0.8” 2020-07-14
OpenJDK Runtime Environment (build 11.0.8+10-post-Debian-1deb10u1)
OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Debian-1deb10u1, mixed mode, sharing)
Blynk Server
server-0.41.13.jar

After I launched Blynk server I saw:

Blynk Server successfully started.
All server output is stored in foldeer ‘/root/logs’ file.
Your Admin url is https://127.0.1.1:9443/admin
Your Admin login email is admin@blynk.cc
Your Admin password is admin

and nothing… I had to interrupt the process by CTRL-Z.

The blynk.log file seems OK:

17:47:35.288 INFO - Using data dir ‘/srv/Blynk’
17:47:35.309 INFO - Region : local. Host : 127.0.1.1.
17:47:35.328 INFO - Using native epoll transport.
17:47:35.590 INFO - Initializing gmail smtp mail transport. Username : example@$
17:47:35.710 INFO - Reports : 0
17:47:35.710 INFO - Didn’t find custom user certificates.
17:47:35.711 INFO - Didn’t find Let’s Encrypt certificates.
17:47:35.711 WARN - You didn’t specified ‘server.host’ or ‘contact.email’ prope$
17:47:35.711 INFO - Using native openSSL provider.
17:47:35.711 WARN - ATTENTION. Server certificate paths (cert : ‘/srv/Blynk’, k$
17:47:36.170 INFO - HTTP API and WebSockets server listening at 8080 port.
17:47:36.170 INFO - HTTPS API, WebSockets and Admin page server listening at 94$
17:47:36.171 INFO - Mqtt hardware server listening at 8440 port.

After kill the process I tried to start the server again and I see now:

Blynk Server successfully started.
All server output is stored in folder ‘/srv/Blynk/logs’ file.

and again nothing… Again CTRL-Z.

What am I doing wrong? Everything seems OK.

Thanks in advance for help

What was it that you were expecting to see at this point?

Have you tried accessing the admin dashboard at

127.0.1.1:9443/admin
or
server_IP:9443/admin

Pete.

Yes, I tried and nothing.

Krzysztof Mazurek

What does “nothing” mean exactly?

Pete.

“Firefox can’t connect to the server 127.0.1.1:9443…”

KM

And what with the actual IP address of the server plus :9443/admin

Pete.

I tried 127.0.1.1, 192.168.1.2 (local IP) and public IP. I think, the problem is with the Blynk server. During starting the Blynk server, it is suspending and not launching to the end of the process.

KM

All I get on the command line when I launch a local server is:

Blynk Server  successfully started.
All server output is stored in folder '/home/pi/logs' file.

and my log file looks very similar to yours.

If you try to launch the server again from the command line do you get a messages saying that the ports are busy and that the server is most likely already running?

Pete.

If I try to launch the server again I get the messages:

Blynk Server successfully started.
All server output is stored in folder ‘/srv/Blynk/logs’ file.

but I can’t use the terminal. No prompt anymore. I need to use CTRL-Z to interrupt suspended process and kill the process (kill -9 ID_process).

KM

So once you get the “Blynk Server successfully started” message, and before you do CTRL-Z, can you access the admin screen via
127.0.1.1:9443/admin
or
192.168.1.2:9443/admin

Pete.

No, I can’t access the admin screen.

KM

Are you able to connect to the sever from the app, using custom server settings?

Pete.

It doesn’t work. When I am trying to connect to the server from the app, I’ve got message: “Can’t connect to the server…”

KM

Are you able to ping the server from your phone or another computer on the same network?

Pete.

All pings seem OK.

Pinging 192.168.1.2 with 32 bytes of data:
Reply from 192.168.1.2: bytes=32 time=38ms TTL=63
Reply from 192.168.1.2: bytes=32 time=40ms TTL=63
Reply from 192.168.1.2: bytes=32 time=39ms TTL=63
Reply from 192.168.1.2: bytes=32 time=38ms TTL=63

Ping statistics for 192.168.1.2:

  • Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),*
    Approximate round trip times in milli-seconds:
  • Minimum = 38ms, Maximum = 40ms, Average = 38ms*

KM