How to use LibreOffice and unoserver to convert docx to pdf in Ubuntu/Debian

  1. Install LibreOffice and unoserver with the following commands:
  2. Make sure the environment is ok:
  3. Start unoserver and take a conversion in diffrerent command line prompt:

  4. If you encounter the font problem, you should add windows fonts to Linux with the following steps.
    1. Copy all fonts files under C:\Windows\Fonts
    2. Remove the .fon files
    3. Copy the font files to Linux and paste the files in /usr/share/fonts/win/. and you should create win directory by yourself.
    4. Update the font cache with the following commands in /usr/share/fonts/win/ :

      If you cannot find the commands, run
    5. You can also check the font status via fc-list
  5. Create a system service for unoserver in /etc/systemd/system/unoserver.service:

    You should also use systemctl daemon-reload to take effect. And if you want to make the service on startup, run systemctl enable daemon-reload

Bypass TPM check in Windows 11 Installation

  1. Press Shift + F10 to enter  the command prompt
  2. Type regedit to enter Windows Register Editor
  3. Go to HKEY_LOCAL_MACHINE\SYSTEM\Setup, and create “LabConfig” key
  4. Add three DWORD (32-bit) value,  BypassTPMCheck, BypassRAMCheck, BypassSecureBootCheck and set all the value to 1.
  5. Closed the regedit and command prompt and enjoy Windows 11 installation.

How to resolve Communications link failure in Pentaho Kettle

The error log like the following below.

2020/08/26 11:12:50 – step1 – ERROR (version 9.1.0.0-206, build 9.1.0.0-206 from 2020-08-01 01.24.45 by kirito) : step1 : Unexpected error at the end of the transformation
2020/08/26 11:12:50 – step2 – Starting entry [entry1]
2020/08/26 11:12:50 – step2 – Starting entry [entry2]
2020/08/26 11:12:50 – step2 – Starting entry [entry3]
2020/08/26 11:12:50 – step1 – ERROR (version 9.1.0.0-206, build 9.1.0.0-206 from 2020-08-01 01.24.45 by kirito) : org.pentaho.di.core.exception.KettleException:
2020/08/26 11:12:50 – step1 – org.pentaho.di.core.exception.KettleException:
2020/08/26 11:12:50 – step1 – Unable to perform logging at the end of the transformation
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Unable to write information to the step log table
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Error occurred while trying to connect to the database
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Connection failed. Verify all connection parameters and confirm that the appropriate driver is installed.
2020/08/26 11:12:50 – step1 – 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.
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Unable to perform logging at the end of the transformation
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Unable to write information to the step log table
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Error occurred while trying to connect to the database
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Connection failed. Verify all connection parameters and confirm that the appropriate driver is installed.
2020/08/26 11:12:50 – step1 – 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.
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – at org.pentaho.di.trans.Trans.fireTransFinishedListeners(Trans.java:1618)
2020/08/26 11:12:50 – step1 – at org.pentaho.di.trans.Trans$1.stepFinished(Trans.java:1359)
2020/08/26 11:12:50 – step1 – at org.pentaho.di.trans.step.BaseStep.markStop(BaseStep.java:3154)
2020/08/26 11:12:50 – step1 – at org.pentaho.di.trans.step.RunThread.run(RunThread.java:122)
2020/08/26 11:12:50 – step1 – at java.lang.Thread.run(Unknown Source)
2020/08/26 11:12:50 – step1 – Caused by: org.pentaho.di.core.exception.KettleException:
2020/08/26 11:12:50 – step1 – Unable to perform logging at the end of the transformation
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Unable to write information to the step log table
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Error occurred while trying to connect to the database
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Connection failed. Verify all connection parameters and confirm that the appropriate driver is installed.
2020/08/26 11:12:50 – step1 – 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.
2020/08/26 11:12:50 – step1 – TT
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – at org.pentaho.di.trans.Trans$9.transFinished(Trans.java:2474)
2020/08/26 11:12:50 – step1 – at org.pentaho.di.trans.Trans.fireTransFinishedListeners(Trans.java:1607)
2020/08/26 11:12:50 – step1 – … 4 more
2020/08/26 11:12:50 – step1 – Caused by: org.pentaho.di.core.exception.KettleException:
2020/08/26 11:12:50 – step1 – Unable to write information to the step log table
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Error occurred while trying to connect to the database
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Connection failed. Verify all connection parameters and confirm that the appropriate driver is installed.
2020/08/26 11:12:50 – step1 – 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.
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – at org.pentaho.di.trans.Trans.writeStepLogInformation(Trans.java:2614)
2020/08/26 11:12:50 – step1 – at org.pentaho.di.trans.Trans$9.transFinished(Trans.java:2472)
2020/08/26 11:12:50 – step1 – … 5 more
2020/08/26 11:12:50 – step1 – Caused by: org.pentaho.di.core.exception.KettleDatabaseException:
2020/08/26 11:12:50 – step1 – Error occurred while trying to connect to the database
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – Connection failed. Verify all connection parameters and confirm that the appropriate driver is installed.
2020/08/26 11:12:50 – step1 – 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.
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – at org.pentaho.di.core.database.Database.normalConnect(Database.java:493)
2020/08/26 11:12:50 – step1 – at org.pentaho.di.core.database.Database.connect(Database.java:389)
2020/08/26 11:12:50 – step1 – at org.pentaho.di.core.database.Database.connect(Database.java:360)
2020/08/26 11:12:50 – step1 – at org.pentaho.di.core.database.Database.connect(Database.java:350)
2020/08/26 11:12:50 – step1 – at org.pentaho.di.trans.Trans.writeStepLogInformation(Trans.java:2605)
2020/08/26 11:12:50 – step1 – … 6 more
2020/08/26 11:12:50 – step1 – Caused by: org.pentaho.di.core.exception.KettleDatabaseException:
2020/08/26 11:12:50 – step1 – Connection failed. Verify all connection parameters and confirm that the appropriate driver is installed.
2020/08/26 11:12:50 – step1 – 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.
2020/08/26 11:12:50 – step1 –
2020/08/26 11:12:50 – step1 – at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:601)
2020/08/26 11:12:50 – step1 – at org.pentaho.di.core.database.Database.normalConnect(Database.java:477)
2020/08/26 11:12:50 – step1 – … 10 more
2020/08/26 11:12:50 – step1 – Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: 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.
2020/08/26 11:12:50 – step1 – at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2020/08/26 11:12:50 – step1 – at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
2020/08/26 11:12:50 – step1 – at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
2020/08/26 11:12:50 – step1 – at java.lang.reflect.Constructor.newInstance(Unknown Source)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:335)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2187)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2220)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2015)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:768)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
2020/08/26 11:12:50 – step1 – at sun.reflect.GeneratedConstructorAccessor104.newInstance(Unknown Source)
2020/08/26 11:12:50 – step1 – at TTsun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
2020/08/26 11:12:50 – step1 – at java.lang.reflect.Constructor.newInstance(Unknown Source)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:385)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:323)
2020/08/26 11:12:50 – step1 – at java.sql.DriverManager.getConnection(Unknown Source)
2020/08/26 11:12:50 – step1 – at java.sql.DriverManager.getConnection(Unknown Source)
2020/08/26 11:12:50 – step1 – at org.pentaho.di.core.database.Database.connectUsingClass(Database.java:585)
2020/08/26 11:12:50 – step1 – … 11 more
2020/08/26 11:12:50 – step1 – Caused by: java.net.SocketException: Permission denied: connect
2020/08/26 11:12:50 – step1 – at java.net.DualStackPlainSocketImpl.connect0(Native Method)
2020/08/26 11:12:50 – step1 – at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
2020/08/26 11:12:50 – step1 – at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
2020/08/26 11:12:50 – step1 – at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
2020/08/26 11:12:50 – step1 – at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
2020/08/26 11:12:50 – step1 – at java.net.PlainSocketImpl.connect(Unknown Source)
2020/08/26 11:12:50 – step1 – at java.net.SocksSocketImpl.connect(Unknown Source)
2020/08/26 11:12:50 – step1 – at java.net.Socket.connect(Unknown Source)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
2020/08/26 11:12:50 – step1 – at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:299)
2020/08/26 11:12:50 – step1 – … 25 more
2020/08/26 11:12:50 – step1 – Transformation detected one or more steps with errors.
2020/08/26 11:12:50 – step1 – Transformation is killing the other steps!

The log is too long, but we need to read it carefully. The main issue is:
Caused by: java.net.SocketException: Permission denied: connect
So the solution is very easy. Open the spoon.bat if you working on Windows, and then modify the java start line like below:

After the fix, the error will be missing.