NL Exception was generated TNS-04603

sonarqube

(Andrew Barrett) #1

I’m not sure if this is a bug or not, but here is the scenario I’m running into:

  1. Oracle DB (12.2.0.0)
  2. Migrated the DB from Windows to Linux
    a) Database is up and running and can sqlplus into it.
  3. TNSNames and Listener.ora are setup.
  4. When I try to startup sonarqube(on another server pointing to the database server) I get the following error:
	at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:108)
	at org.sonar.db.DefaultDatabase.start(DefaultDatabase.java:75)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
	at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
	at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
	at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
	at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
	at org.picocontainer.behaviors.Stored.start(Stored.java:110)
	at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
	at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
	at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
	at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
	at org.sonar.server.platform.platformlevel.PlatformLevel.start(PlatformLevel.java:90)
	at org.sonar.server.platform.platformlevel.PlatformLevel1.start(PlatformLevel1.java:156)
	at org.sonar.server.platform.Platform.start(Platform.java:211)
	at org.sonar.server.platform.Platform.startLevel1Container(Platform.java:170)
	at org.sonar.server.platform.Platform.init(Platform.java:86)
	at org.sonar.server.platform.web.PlatformServletContextListener.contextInitialized(PlatformServletContextListener.java:45)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4745)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5207)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.sql.SQLException: Cannot create PoolableConnectionFactory (IO Error: NL Exception was generated TNS-04603: Invalid syntax error: Unexpected char "#" while parsing KEY)
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2385)
	at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2110)
	at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1563)
	at org.sonar.db.profiling.NullConnectionInterceptor.getConnection(NullConnectionInterceptor.java:31)
	at org.sonar.db.profiling.ProfiledDataSource.getConnection(ProfiledDataSource.java:317)
	at org.sonar.db.DefaultDatabase.checkConnection(DefaultDatabase.java:106)
	... 30 common frames omitted
Caused by: java.sql.SQLRecoverableException: IO Error: NL Exception was generated TNS-04603: Invalid syntax error: Unexpected char "#" while parsing KEY
	at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:774)
	at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:688)
	at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:39)
	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:691)
	at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:53)
	at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:291)
	at org.apache.commons.dbcp2.BasicDataSource.validateConnectionFactory(BasicDataSource.java:2395)
	at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2381)
	... 35 common frames omitted
Caused by: oracle.net.ns.NetException: NL Exception was generated TNS-04603: Invalid syntax error: Unexpected char "#" while parsing KEY
	at oracle.net.resolver.AddrResolution.resolveAddrTree(AddrResolution.java:777)
	at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:510)
	at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:660)
	at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:639)
	at oracle.net.ns.NSProtocolNIO.negotiateConnection(NSProtocolNIO.java:189)
	at oracle.net.ns.NSProtocol.connect(NSProtocol.java:317)
	at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1438)
	at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:518)

Now, I’m I’ve checked everything I can think of, I even got a light weight tool call jdbc-tester and I’m getting the same error from it. I’m thinking it is an issue with firewall but I can telnet to port 1521 from source to destination server. I’ve also tried netcat, and this works as well. This leads me to believe it’s not a firewall issue.

Any help would be appreciated.


(Andrew Barrett) #2

Update:

I checked the tnslsnr log file of the database, and the connection is being established. I had a dba look at the error, and he said it seems like the character set is not happy in the database vs what the application is looking for. So I checked the character set of both the old database(still running and sonar is connected to it without any issues), and the migrated database. The character set is the same. So at this point I dont know what sonarqube is complaining about.


(Andrew Barrett) #3

Update:

I did see that the old database is running Oracle 12.1.0.1.0 and the new database is running 12.2.0.1.0. Not sure if this will cause an issue.