0

Connecting wso2am-2.0.0 and wso2am-analytics-2.0.0 on PGSQL (9.5) database (having common WSO2AM_STATS_DB database), we receive a following exception:

TID: [-1] [] ERROR {org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter} -  Error in executing task: Error while saving dat
a to the table API_DESTINATION_SUMMARY : Job aborted due to stage failure: Task 0 in stage 54296.0 failed 1 times, most recent failure: Lost task 0.0
in stage 54296.0 (TID 50425, localhost): java.sql.BatchUpdateException: Batch entry 0 INSERT INTO API_DESTINATION_SUMMARY (api, version, apiPublisher,
 context, destination, total_request_count, hostName, year, month, day, time) VALUES ('test01', 'v1.0.0', NULL, '/test/v1.0.0', 'http://demo6009762.mo
ckable.io', 1, 'wso2apimgr3', 2017, 1, 26, '2017-01-26 15:59') ON CONFLICT (api,version,apiPublisher,context,destination,hostName,year,month,day) DO U
PDATE SET total_request_count=EXCLUDED.total_request_count, time=EXCLUDED.time was aborted: ERROR: null value in column "apipublisher" violates not-nu
ll constraint

full exception is here.

According to the logs the direct cause is that the apipublisher field is null what should not happen.

So now I have a few questions:

How do I prevent that? How do I configure the apipublisher value?. And How do I get rid of the invalid data

Thank you for any hint

Community
  • 1
  • 1
gusto2
  • 11,210
  • 2
  • 17
  • 36

1 Answers1

1

There is a reported issue for this. You can apply the fix mentioned in the jira ticket.

Pubci
  • 3,834
  • 1
  • 13
  • 28
  • well - you mean I need to rebuilt the WSO2AM server from source? :O Or - I see it's related to the anonymous mode. What does the mode means? That a client was not authenticated? We could enforce that – gusto2 Jan 27 '17 at 09:13
  • Thank you for your answer, I see the issue is fixed in WSO2AM 2.1, we will try. Still - how do I get rid of the invalid data? Which table is the event stream, so we could delete the data? – gusto2 Jan 27 '17 at 09:21
  • You can create a patch and apply it - http://stackoverflow.com/questions/11306929/how-to-apply-patch-files-in-wso2-carbon – Pubci Jan 27 '17 at 11:31
  • I think if you update the spark scripts you can update the data. https://github.com/wso2/analytics-apim/pull/318/files – Pubci Jan 27 '17 at 11:33
  • Thank you :D I see all patches are already implemented in WSO2APIM 2.1.0 :) I will give a try. If not, I will patch. Thank you for the resources – gusto2 Jan 27 '17 at 11:41