Autosys events submitted through Webservices return HTTP 500
search cancel

Autosys events submitted through Webservices return HTTP 500

book

Article ID: 232860

calendar_today

Updated On:

Products

Autosys Workload Automation

Issue/Introduction

Autosys job events submitted through webservices POST request return HTTP 500 (Internal Server Error)
 
POST AEWS/event/cancel-job -- Cancel a Job
POST AEWS/event/force-start-job -- Start a Job by Force
POST AEWS/event/change-status-job -- Change the Job Status
POST AEWS/event/hold-job -- Put a Job in ON_HOLD status
POST AEWS/event/ice-job -- Put a Job in ON_ICE status
POST AEWS/event/noexec-job -- Put a Job in ON_NOEXEC status
POST AEWS/event/off-hold-job -- Take a Job Off Hold
POST AEWS/event/off-ice-job -- Take a Job Off Ice
POST AEWS/event/off-noexec-job -- Take a Job Off the NOEXEC Status
POST AEWS/event/release-resources-job -- Release Resources Held by a Job
POST AEWS/event/reply-job -- Reply to a Job
POST AEWS/event/restart-job -- Restart a Job
POST AEWS/event/start-job -- Start a Job
POST AEWS/event/suspend-job -- Suspend a Job
POST AEWS/event/resume-job -- Resume a Job

 

# curl -kv -u "autosys:redhat" -X POST -H 'Content-Type: application/json' -d '{"jobName":"test","comment":"testing force-start-job"}' "https://webserver-host:9443/AEWS/event/force-start-job"

* About to connect() to webserver-host port 9443 (#0)

*   Trying 10.0.0.1...

* Connected to webserver-host (10.0.0.1) port 9443 (#0)

* Initializing NSS with certpath: sql:/etc/pki/nssdb

* skipping SSL peer certificate verification

* SSL connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256

* Server certificate:

* subject: CN=webserver-host,OU=WAAE,O=CA

* start date: Feb 19 04:55:57 2021 GMT

* expire date: Feb 19 04:55:57 2031 GMT

* common name: webserver-host

* issuer: CN=webserver-host,OU=WAAE,O=CA

* Server auth using Basic with user 'autosys'

> POST /AEWS/event/force-start-job HTTP/1.1

> Authorization: Basic YXV0b3N5czpyZWRoYXQ=

> User-Agent: curl/7.29.0

> Host: webserver-host:9443

> Accept: */*

> Content-Type: application/json

> Content-Length: 54

> 

* upload completely sent off: 54 out of 54 bytes

< HTTP/1.1 500 

< Content-Length: 0

< Date: Thu, 27 Jan 2022 11:08:29 GMT

< Connection: close

< 

* Closing connection 0

#

The following error is logged in the waae_webserver.log:

2022-01-27 06:08:29,813 [https-jsse-nio-9443-exec-6] ERROR com.ca.waae.ws.EventResource - CAUAJM_E_71251 Unexpected error has occurred.

java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0

*

^

        at java.util.regex.Pattern.error(Pattern.java:1969)

        at java.util.regex.Pattern.sequence(Pattern.java:2137)

        at java.util.regex.Pattern.expr(Pattern.java:2010)

        at java.util.regex.Pattern.compile(Pattern.java:1702)

        at java.util.regex.Pattern.<init>(Pattern.java:1352)

        at java.util.regex.Pattern.compile(Pattern.java:1028)

        at com.ca.eiam.SafeUtil.match(SafeUtil.java:924)

        at com.ca.eiam.SafePolicy.getBestMatchVal(SafePolicy.java:828)

        at com.ca.eiam.SafeCache.getMatchingPolicyQ(SafeCache.java:1109)

        at com.ca.eiam.SafeContext.privAuthorizeWithSession(SafeContext.java:7166)

        at com.ca.eiam.SafeContext.privAuthorizeWithIdentity(SafeContext.java:7918)

        at com.ca.eiam.SafeContext.authorizeWithIdentity(SafeContext.java:2870)

        at com.ca.waae.security.EemProvider.isAuthorized(Unknown Source)

        at com.ca.waae.security.AESecurity.isAuthorized(Unknown Source)

        at com.ca.waae.wsquery.WsSendEventQuery.hasEventAccess(Unknown Source)

        at com.ca.waae.wsquery.WsSendEventQuery.sendOneEvent(Unknown Source)

        at com.ca.waae.wsquery.WsSendEventQuery.processJobEvents(Unknown Source)

        at com.ca.waae.wsquery.WsSendEventQuery.processSendEvent(Unknown Source)

        at com.ca.waae.wsquery.WsSendEventQuery.execute(Unknown Source)

        at com.ca.waae.ws.EventResource.processRequest(Unknown Source)

        at com.ca.waae.ws.EventResource.forceStart(Unknown Source)

        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 com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)

        at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)

        at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)

        at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)

        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)

        at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)

        at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)

        at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)

        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)

        at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)

        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)

        at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)

        at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)

        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)

        at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)

        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)

        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)

        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:666)

        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)

        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)

        at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:688)

        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)

 

Environment

Release : 12.0

Component :

Cause

This problem appears if EEM as-owner policy resource is defined with an incorrect regular expression.

Resolution

The user who is submitting the Autosys web services request is authenticated against the EEM as-owner policies.

The resource has to be defined with appropriate regular expression if the policy's check box "treat the resource as a regular expression" is enabled.

As per the exception in the autosys webservices.log, update/Correct the resource class expression in the appropriate as_owner policy where the resource mentioned in the error is defined -

java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0

*

^

The default behaviour of the EEM server policies with incorrect regular expressions in the resource class would result in auth denial for the users.

The exception in the autosys web services log has been handled under solution# 99111403.

https://support.broadcom.com/web/ecx/solutiondetails?aparNo=99111403&os=MULTI-PLATFORM