Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Goa
-
Component/s: None
-
Labels:None
-
Environment:
QA4 -
Listener = Jamestown BidMgr P 43
Core- Jamestown Core P 14
-
Story Points:5
-
Sprint:Goa Sprint 1
Description
While attempting to build the QA4 system, I had a failed deployment that created an account in AdWords for my merchant (2a9af568-4e2e-4832-bbc7-76a970e66a03_1). I then fixed the setup issues and redeployed that order. It created a second AdWords account for that merchant (2a9af568-4e2e-4832-bbc7-76a970e66a03_2). When the deployment wrapped up, it tried to set the budget accrual status but failed since the system didn't know what to do with the two accounts. It threw the exception below.
Even though this happened through a failed original deployment, this could happen legitimately. AML will create multiple accounts in adwords based on the number of campaigns associated with the merhcant. I think every 100 campaigns, a new account will be created in AdWords with a _x suffix at the end of it. When this happens, budget accrual will not be set correctly for these accounts. They will not accrue budget.
---------------------------
ID: 17
Encoding: UTF-8
Content-Type: text/xml
Headers: {}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:updateCampaignStatusResponse xmlns:ns2="http://thesearchagency.com/smb/core"><updateCampaignStatusResponse><header><requestID>35aec3ed-1177-4a0f-b4f1-da748671199c</requestID></header><customerID>2a9af568-4e2e-4832-bbc7-76a970e66a03</customerID><campaignResult><campaignID>1</campaignID><result><resultCode>success</resultCode><resultString>Information: [1_GM:SUCCEEDED] [1_GT:SUCCEEDED] </resultString></result></campaignResult></updateCampaignStatusResponse></ns2:updateCampaignStatusResponse></soap:Body></soap:Envelope>
--------------------------------------
13:56:46,274 INFO [LoggingInInterceptor] Inbound Message
----------------------------
ID: 18
Address: /SMB-ADS/AdMaxDeploymentService
Encoding: UTF-8
Content-Type: text/xml; charset=UTF-8
Headers:
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><core:updateCampaignBudgetAccrualStatus xmlns:core="http://thesearchagency.com/smb/core">
<updateCampaignBudgetAccrualStatusRequest>
<header>
<requestID>35aec3ed-1177-4a0f-b4f1-da748671199c</requestID>
</header>
<customerID>2a9af568-4e2e-4832-bbc7-76a970e66a03</customerID>
<campaignBudgetAccrualStatusList>
<campaignID>1</campaignID>
<campaignBudgetAccrualStatus>active</campaignBudgetAccrualStatus>
</campaignBudgetAccrualStatusList>
</updateCampaignBudgetAccrualStatusRequest>
</core:updateCampaignBudgetAccrualStatus></soap:Body></soap:Envelope>
--------------------------------------
13:56:46,303 INFO [AdMaxAccountDeploymentBD] validated: []
13:56:46,304 DEBUG [JdbcTemplate] Executing prepared SQL query
13:56:46,304 DEBUG [JdbcTemplate] Executing prepared SQL statement [select * from accounts where description = ? ]
13:56:46,308 DEBUG [JdbcTemplate] Executing prepared SQL query
13:56:46,308 DEBUG [JdbcTemplate] Executing prepared SQL statement [select * from sites where accountID = ? ]
13:56:46,311 DEBUG [JdbcTemplate] Executing prepared SQL query
13:56:46,311 DEBUG [JdbcTemplate] Executing prepared SQL statement [select * from waypoints where siteID = ? ]
13:56:46,325 INFO [AdMaxAccountDeploymentBD] Account: Account [theAccountID=2, theDescription=2a9af568-4e2e-4832-bbc7-76a970e66a03, theTier=1, thePriority=50, theReportClickOuts=0, theReportConversions=0, theConversionTypes=[], isBidManaged=1, isActive=true, thePerformanceMetric=cpa, theProvidesConversionData=true, theAddConversionDate=false, theFractionalConversionCounts=false, theHideNullSources=0, theNowTime=Wed Oct 23 13:56:46 UTC 2013, theWarehouseDB=warehouse_1, theDatabaseInstance=1, theWarehouseInstance=1, isOnline=true, currencyCode=, theSites=[Site [theSiteId=1, theAccountId=2, isDefault=true, theDescription=2a9af568-4e2e-4832-bbc7-76a970e66a03_Main, theInternalURLPattern=, hasIgnorePixels=false, theWaypoints=[Waypoint [theWaypointId=1, theSiteId=1, theGroupId=0, theType=2, theConverstionType=null, theDefaultCost=0.0, theDefaultValue=0.0, theTestingURL=, theDestinationURL=, theDescription=Page View, thePassParams=, theDebounceWindow=30, theLimitPerWindow=1, theLastTestedDate=null, theTestStatus=null], Waypoint [theWaypointId=2, theSiteId=1, theGroupId=0, theType=4, theConverstionType=null, theDefaultCost=0.0, theDefaultValue=0.0, theTestingURL=, theDestinationURL=, theDescription=Conversion, thePassParams=, theDebounceWindow=0, theLimitPerWindow=0, theLastTestedDate=null, theTestStatus=null]]]]]
13:56:46,325 INFO [AdMaxAccountDeploymentBD] Updating CampaignID [1] budget accrual status to [active]
13:56:46,333 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
13:56:46,333 WARN [InterceptorsFactory] EJBTHREE-1246: Do not use InterceptorsFactory with a ManagedObjectAdvisor, InterceptorRegistry should be used via the bean container
13:56:46,339 INFO [CampaignBudgetAccrualStatusServiceBD] Entering CampaignBudgetAccrualStatusServiceImpl.updateCampaignBudgetAccrualStatus method.
13:56:46,345 INFO [CampaignBudgetAccrualStatusServiceBD] Searching for last CampaignBudgetAccrualStatus record for CampiagnId [1]
13:56:46,347 DEBUG [JdbcTemplate] Executing prepared SQL query
13:56:46,347 DEBUG [JdbcTemplate] Executing prepared SQL statement [select * from admaxCampaignBudgetAccrualStatus where admaxCampaignID = ? and endDate is NULL]
13:56:46,360 INFO [CampaignBudgetAccrualStatusServiceBD] CampaignId [1] last CampaignBudgetAccrualStatus current status
CampaignBugetAccrualStatus [theId=1, theCampaignId=1, theStartDate=2013-10-23, theEndDate=null, theStatus=active]
13:56:46,365 DEBUG [JdbcTemplate] Executing prepared SQL query
13:56:46,365 DEBUG [JdbcTemplate] Executing prepared SQL statement [select accountID, currencyCode, timeZoneId from gce_googleAccount where accountID = ? ]
13:56:46,412 INFO [AdMaxAccountDeploymentBD] exception after calling budget accrual service
javax.ejb.EJBException: com.thesearchagency.core.smb.dao.DAOException: ERROR Could not read Page :: Incorrect result size: expected 1, actual 2
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:77)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176)
at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207)
at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164)
at $Proxy956.updateCampaignBudgetAccrualStatus(Unknown Source)
at com.thesearchagency.core.smb.service.admaxdeployment.component.AdMaxAccountDeploymentBD.updateCampaignBudgetAccrualStatus(AdMaxAccountDeploymentBD.java:212)
at com.thesearchagency.core.smb.service.admaxdeployment.binding.AdMaxDeploymentWS.updateCampaignBudgetAccrualStatus(AdMaxDeploymentWS.java:135)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.wsf.common.invocation.AbstractInvocationHandlerJSE.invoke(AbstractInvocationHandlerJSE.java:129)
at org.jboss.wsf.stack.cxf.AbstractInvoker._invokeInternal(AbstractInvoker.java:164)
at org.jboss.wsf.stack.cxf.AbstractInvoker.invoke(AbstractInvoker.java:112)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:255)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:113)
at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:97)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:461)
at org.jboss.wsf.stack.cxf.ServletControllerExt.invoke(ServletControllerExt.java:172)
at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:57)
at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:162)
at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:90)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:179)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:103)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:159)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:662)
Caused by: com.thesearchagency.core.smb.dao.DAOException: ERROR Could not read Page :: Incorrect result size: expected 1, actual 2
at com.thesearchagency.core.smb.dao.account.impl.GoogleAccountDAOSpringJDBC.findByAccountId(GoogleAccountDAOSpringJDBC.java:40)
at com.thesearchagency.core.smb.service.campaign.service.component.CampaignBudgetAccrualStatusServiceBD.getNewDate(CampaignBudgetAccrualStatusServiceBD.java:246)
at com.thesearchagency.core.smb.service.campaign.service.component.CampaignBudgetAccrualStatusServiceBD.updateCampaignBudgetAccrualStatus(CampaignBudgetAccrualStatusServiceBD.java:114)
at com.thesearchagency.core.smb.service.campaign.service.binding.CampaignBudgetAccrualStatusEJB.updateCampaignBudgetAccrualStatus(CampaignBudgetAccrualStatusEJB.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111)
at org.jboss.ejb3.EJBContainerInvocationWrapper.invokeNext(EJBContainerInvocationWrapper.java:69)
at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:73)
at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:59)
at sun.reflect.GeneratedMethodAccessor429.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:72)
at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_1614936177.invoke(InvocationContextInterceptor_z_fillMethod_1614936177.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:88)
at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_1614936177.invoke(InvocationContextInterceptor_z_setup_1614936177.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:79)
... 66 more
Caused by: org.springframework.dao.IncorrectResultSizeDataAccessException: Incorrect result size: expected 1, actual 2
at org.springframework.dao.support.DataAccessUtils.requiredSingleResult(DataAccessUtils.java:74)
at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:729)
at com.thesearchagency.core.smb.dao.account.impl.GoogleAccountDAOSpringJDBC.findByAccountId(GoogleAccountDAOSpringJDBC.java:33)
... 100 more
13:56:46,419 INFO [LoggingInInterceptor] Outbound Message
---------------------------
ID: 18
Encoding: UTF-8
Content-Type: text/xml
Headers: {}
Payload: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns2:updateCampaignBudgetAccrualStatusResponse xmlns:ns2="http://thesearchagency.com/smb/core"><updateCampaignBudgetAccrualStatusResponse><header><requestID>35aec3ed-1177-4a0f-b4f1-da748671199c</requestID></header><customerID>2a9af568-4e2e-4832-bbc7-76a970e66a03</customerID><campaignResult><campaignID>1</campaignID><result><resultCode>failure</resultCode><resultString>Could not update campaign budget accrual status: com.thesearchagency.core.smb.dao.DAOException: ERROR Could not read Page :: Incorrect result size: expected 1, actual 2</resultString></result></campaignResult></updateCampaignBudgetAccrualStatusResponse></ns2:updateCampaignBudgetAccrualStatusResponse></soap:Body></soap:Envelope>
Dev TODO: change CampaignBudgetAccrualStatusServiceBD.getNewDate to handle when googleAccountDAO.findByAccountId returns more than one result