cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP/1.1 401 Unauthorized warning followed by ORA-00936 when building via Jenkins

Highlighted
Contributor

HTTP/1.1 401 Unauthorized warning followed by ORA-00936 when building via Jenkins

Hi,

 

I encounter warnings and errors when creating a build with Jenkins but the test is running fine whenever I run it directly with SoapUI.

 

DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Receiving response: HTTP/1.1 401 Unauthorized
DEBUG [HttpClientSupport$SoapUIHttpClient] Connection can be kept alive indefinitely
DEBUG [HttpClientSupport$SoapUIHttpClient] Target requested authentication
WARN [HttpClientSupport$SoapUIHttpClient] Authentication error: Unable to respond to any of these challenges:{}
...
Error [SoapUI] An error occured [ORA-00936:missing expression]
....

 

I'm wondering if there is any setup I should watch out for? We are using tokens but there's also an API request to generate one before proceeding with the rest of the test cases so I'm wondering where the 401 is coming from. For ORA-00093, when I searched online it says on one page that this might be something on SELECT statement but why is it failing only when creating a build via Jenkins?
"an Engineer without a degree, a QA tester without any official certification (just yet ;-) ) "
12 REPLIES 12
Highlighted
Moderator

Re: HTTP/1.1 401 Unauthorized warning followed by ORA-00936 when building via Jenkins

Hi Debra,

 

Thank you for your post. 

1. As for the Authentication error, I advise that you check that the pre-emptive authentication option is enabled in Preferences > HTTP > Adds authentication information to outgoing request. Since you use tokens, make sure that a token isn't expired.

 

2. Yes, basically this error means that some part of an SQL clause or expression has been omitted. You can log the SQL statement when you run tests via TestRunner (via Jenkins) and check whether it works fine. The following article can be helpful for you: http://www.developerfeed.com/javasqlsqlexception-ora-00936-missing-expression/.



 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!
Highlighted
Community Hero

Re: HTTP/1.1 401 Unauthorized warning followed by ORA-00936 when building via Jenkins

You mean it works well from SoapUI and only does not work from jenkins? what is query causing the issue?


Regards,
Rao.
Highlighted
Occasional Contributor

Re: HTTP/1.1 401 Unauthorized warning followed by ORA-00936 when building via Jenkins


@nmrao wrote:
You mean it works well from SoapUI and only does not work from jenkins? what is query causing the issue?

Hi Rao,

 

       We only encounter the said error in Jenkins if we used the non-active environment from our SoapUI project file.. but in our Pom file we defined another environment, please see below set-up.

<configuration>
<projectFile>C:\Git\soapui\BTS API.xml</projectFile>
<outputFolder>${project.basedir}/output/</outputFolder>
<junitReport>true</junitReport>
<testSuite>All Markets</testSuite>
<environment>ISBB-162</environment>
<exportwAll>true</exportwAll>
<printReport>true</printReport>
<testFailIgnore>true</testFailIgnore>
</configuration>

the active environment in our project file is Vanilla and in this POM we want to run the ISBB-162 environment, but when jenkins execute the Pom file we are encountering below error,

10:29:56,850 ERROR [SoapUI] An error occurred [ORA-00936: missing expression
], see error log for details
java.sql.SQLSyntaxErrorException: ORA-00936: missing expression

	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
	at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:399)
	at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:1059)
	at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:522)
	at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:257)
	at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:587)
	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:225)
	at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:53)
	at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:774)
	at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:925)
	at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1111)
	at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:4798)
	at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:4901)
	at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1385)
	at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.load(JdbcSubmit.java:206)
	at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.runQuery(JdbcSubmit.java:174)
	at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.run(JdbcSubmit.java:147)
	at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcSubmit.<init>(JdbcSubmit.java:79)
	at com.eviware.soapui.impl.wsdl.panels.teststeps.JdbcRequest.submit(JdbcRequest.java:116)
	at com.eviware.soapui.impl.wsdl.teststeps.JdbcRequestTestStep.run(JdbcRequestTestStep.java:192)
	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:213)
	at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47)
	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:139)
	at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:47)
	at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:129)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

it works if we use the active environment, the solution we are doing right now to run the other environment is by changing the active environment. 

 

We have the same issue from this post 

https://community.smartbear.com/t5/SoapUI-NG/Maven-SoapUi-how-to-parametrized-environment-endpoint/t...

Highlighted
Community Hero

Re: HTTP/1.1 401 Unauthorized warning followed by ORA-00936 when building via Jenkins

No voice in maven.

Mainly I was asking for the query which is causing the failure.

It appears that @Nastya_Khovrina already suggested you regarding oracle error message. Try it.


Regards,
Rao.
Highlighted
Contributor

Re: HTTP/1.1 401 Unauthorized warning followed by ORA-00936 when building via Jenkins

Hi, I've already tried putting a tick to Preferences > HTTP Settings > Authenticate Preemptively > Adds authentication information to outgoing request. I still encountered the error. As for the Oracle issue, it is not encountered when running test directly from SoapUI. Raiquee's workaround works for our end at the moment. I will post a feature/fix request for this later since the related issue mentioned still remains open since 2015.

"an Engineer without a degree, a QA tester without any official certification (just yet ;-) ) "
Highlighted
Occasional Contributor

Re: HTTP/1.1 401 Unauthorized warning followed by ORA-00936 when building via Jenkins

Here's the query 

 

Select ${#Project#GP_DBName_1}.MARKETS.ID From ${#Project#GP_DBName_1}.MARKETS 
where 
${#Project#GP_DBName_1}.MARKETS.EVENTID = ${#TestCase#eventId}
And
(RTRIM(UPPER(${#Project#GP_DBName_1}.MARKETS.DESCRIPTION)) =
RTRIM(UPPER('${#TestCase#marketType}')) OR ${#Project#GP_DBName_1}.MARKETS.MARKETTYPEID = ${#TestCase#marketTypeId})

Already tried the solution provided by Nastya but we still encountering the error

Highlighted
Community Hero

Re: HTTP/1.1 401 Unauthorized warning followed by ORA-00936 when building via Jenkins

Please see if the below helps:

 

 

def queryTemplate = """Select ${#Project#GP_DBName_1}.MARKETS.ID From ${#Project#GP_DBName_1}.MARKETS 
where 
${#Project#GP_DBName_1}.MARKETS.EVENTID = ${#TestCase#eventId}
And
(RTRIM(UPPER(${#Project#GP_DBName_1}.MARKETS.DESCRIPTION)) =
RTRIM(UPPER(\'${#TestCase#marketType}\')) OR ${#Project#GP_DBName_1}.MARKETS.MARKETTYPEID = ${#TestCase#marketTypeId})"""

def query = context.expand(queryTemplate)

log.info "Final query is :\n $query"

//Now pass the above "query" object to sql to execute


Regards,
Rao.
Highlighted
Occasional Contributor

Re: HTTP/1.1 401 Unauthorized warning followed by ORA-00936 when building via Jenkins

Hi Rao,

 

We tried the solution you provided but we encountered a new error, tried running it on soapui

Thu May 04 15:45:21 CST 2017:ERROR:An error occurred [ORA-00942: table or view does not exist
], see error log for details

 

 

 

 

Highlighted
Community Hero

Re: HTTP/1.1 401 Unauthorized warning followed by ORA-00936 when building via Jenkins

From log statement you can validate if the query is correct or not. Isn't it? Have you looked at it?


Regards,
Rao.