netfishers-onl / Netshot

Network Configuration and Compliance Management
http://www.netfishers.onl/netshot
249 stars 60 forks source link

NETSHOT FATAL ERROR: Unable to connect to the database, see logs for more details #278

Closed AlliosELB closed 11 months ago

AlliosELB commented 1 year ago

Hello,

I'm trying to install Netshot but I have an issue where the service is not able to start.

When I check the logs, I see the logs below :

[root@ple70netshot bin]# service netshot status Redirecting to /bin/systemctl status netshot.service × netshot.service - Netshot Loaded: loaded (/etc/systemd/system/netshot.service; enabled; preset: disabled) Active: failed (Result: exit-code) since Mon 2023-12-04 11:35:23 WAT; 1min 44s ago Duration: 850ms Process: 7171 ExecStart=/usr/bin/java -jar /usr/local/netshot/netshot.jar (code=exited, status=1/FAILURE) Main PID: 7171 (code=exited, status=1/FAILURE) CPU: 1.447s

déc. 04 11:35:22 ple70netshot java[7171]: 11:35:22.923 [main] INFO onl.netfishers.netshot.Netshot - Starting Netshot déc. 04 11:35:22 ple70netshot java[7171]: 11:35:22.925 [main] ERROR onl.netfishers.netshot.Netshot - Unable to read the configuration file netshot.conf. déc. 04 11:35:22 ple70netshot java[7171]: 11:35:22.950 [main] INFO onl.netfishers.netshot.Netshot - Switching to file logging, into /var/log/netshot/netshot.log, level WARN, rotation using 5 files of ma> déc. 04 11:35:23 ple70netshot java[7171]: NETSHOT FATAL ERROR: Unable to connect to the database, see logs for more details déc. 04 11:35:23 ple70netshot java[7171]: java.lang.RuntimeException: Unable to connect to the database, see logs for more details déc. 04 11:35:23 ple70netshot java[7171]: at onl.netfishers.netshot.Database.update(Database.java:600) déc. 04 11:35:23 ple70netshot java[7171]: at onl.netfishers.netshot.Netshot.main(Netshot.java:421) déc. 04 11:35:23 ple70netshot systemd[1]: netshot.service: Main process exited, code=exited, status=1/FAILURE déc. 04 11:35:23 ple70netshot systemd[1]: netshot.service: Failed with result 'exit-code'. déc. 04 11:35:23 ple70netshot systemd[1]: netshot.service: Consumed 1.447s CPU time.

2023-12-04 11:55:07,391 ERROR [main] Database: Unable to connect to the database (for the initial schema update) java.sql.SQLNonTransientConnectionException: Could not create KeyStore instance [problem accessing trust store] at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:70) at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836) at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:456) at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:677) at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:228) at onl.netfishers.netshot.Database.update(Database.java:590) at onl.netfishers.netshot.Netshot.main(Netshot.java:421) Caused by: com.mysql.cj.exceptions.SSLParamsException: Could not create KeyStore instance [problem accessing trust store] at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:151) at com.mysql.cj.protocol.ExportControlled.getSSLContext(ExportControlled.java:561) at com.mysql.cj.protocol.ExportControlled.performTlsHandshake(ExportControlled.java:321) at com.mysql.cj.protocol.StandardSocketFactory.performTlsHandshake(StandardSocketFactory.java:188) at com.mysql.cj.protocol.a.NativeSocketConnection.performTlsHandshake(NativeSocketConnection.java:99) at com.mysql.cj.protocol.a.NativeProtocol.negotiateSSLConnection(NativeProtocol.java:325) at com.mysql.cj.protocol.a.NativeAuthenticationProvider.connect(NativeAuthenticationProvider.java:164) at com.mysql.cj.protocol.a.NativeProtocol.connect(NativeProtocol.java:1342) at com.mysql.cj.NativeSession.connect(NativeSession.java:157) at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:956) at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826) ... 7 common frames omitted Caused by: java.security.KeyStoreException: problem accessing trust store at java.base/sun.security.ssl.TrustManagerFactoryImpl.engineInit(TrustManagerFactoryImpl.java:73) at java.base/javax.net.ssl.TrustManagerFactory.init(TrustManagerFactory.java:278) at com.mysql.cj.protocol.ExportControlled.getSSLContext(ExportControlled.java:543) ... 16 common frames omitted Caused by: java.io.IOException: stream does not represent a PKCS12 key store at org.bouncycastle.jcajce.provider.keystore.pkcs12.PKCS12KeyStoreSpi.engineLoad(Unknown Source) at java.base/java.security.KeyStore.load(KeyStore.java:1479) at java.base/sun.security.ssl.TrustStoreManager$TrustAnchorManager.loadKeyStore(TrustStoreManager.java:365) at java.base/sun.security.ssl.TrustStoreManager$TrustAnchorManager.getTrustedCerts(TrustStoreManager.java:313) at java.base/sun.security.ssl.TrustStoreManager.getTrustedCerts(TrustStoreManager.java:55) at java.base/sun.security.ssl.TrustManagerFactoryImpl.engineInit(TrustManagerFactoryImpl.java:49)

Your help is appreciated.

SCadilhac commented 12 months ago

We do not support MySQL anymore as underlying database for Netshot, you should go with PostgreSQL as indicated in the install guide.