BLYNK
HOME       📲 GETTING STARTED       📗 DOCS       ❓HELP CENTER       👉 SKETCH BUILDER

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

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!