让WSO2AM(API Manager)2.1.0与Analytics服务器(在PostgreSQL上)我们看到以下问题:
如果客户端调用没有 User-Agent 标头的API,则分析服务器无法完成处理,并且在分析服务器的日志中(wso2carbon.log)存在以下例外情况:< / p>
TID: [-1] [] [2017-10-10 10:55:17,292] ERROR {org.apache.spark.executor.Executor} - Exception in task 0.0 in stage 41522.0 (TID 32785) {org.apache.spark.executor.Executor}
java.sql.BatchUpdateException: Batch entry 0 INSERT INTO API_REQ_USER_BROW_SUMMARY (api, version, apiPublisher, tenantDomain, total_request_count, year, month, day, requestTime, os, browser) VALUES ('agenda.brussels', '0.0.2', 'admin', 'carbon.super', 1, 2017, 10, 10, 1507625491000, NULL, NULL) ON CONFLICT (api,version,apiPublisher,year,month,day,os,browser,tenantDomain) DO UPDATE SET total_request_count=EXCLUDED.total_request_count, requestTime=EXCLUDED.requestTime was aborted: ERROR: null value in column "os" violates not-null constraint
Detail: Failing row contains (agenda.brussels, 0.0.2, admin, carbon.super, 1, 2017, 10, 10, 1507625491000, null, null). Call getNextException to see other errors in the batch.
at org.postgresql.jdbc.BatchResultHandler.handleError(BatchResultHandler.java:145)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2156)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:460)
at org.postgresql.jdbc.PgStatement.executeBatch(PgStatement.java:793)
at org.postgresql.jdbc.PgPreparedStatement.executeBatch(PgPreparedStatement.java:1659)
...
Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "os" violates not-null constraint
Detail: Failing row contains (agenda.brussels, 0.0.2, admin, carbon.super, 1, 2017, 10, 10, 1507625491000, null, null).
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2455)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2155)
... 16 more
显然&#34; os&#34;字段被假定为非空。 API和客户端是公共的,因此我们无法强制执行客户端发送的请求。
我看到临时措施
问题:
感谢所有提示