api-manager icon indicating copy to clipboard operation
api-manager copied to clipboard

[AI API] API invocation logs WARN message in server

Open ashera96 opened this issue 1 year ago • 2 comments

Description

When invoking an AI API, the following WARN logs are getting logged in the server:

[2024-10-07 15:31:19,634]  WARN - APIUtil The configurations related to Api Key Generator Impl class in APIStore is missing in api-manager.xml. Hence returning the default value.
[2024-10-07 15:31:19,635]  WARN - APIUtil The configurations related to APIKey sign keystore in APIStore is missing in api-manager.xml. Hence returning the default value.
[2024-10-07 15:31:19,635]  WARN - APIUtil The configurations related to APIKey sign keystore in APIStore is missing in api-manager.xml. Hence returning the default value.
[2024-10-07 15:31:25,198]  WARN - SourceHandler I/O error: Received fatal alert: certificate_unknown
[2024-10-07 15:31:25,498]  WARN - LLMProviderService Attribute not found in the payload for identifier: $.model
[2024-10-07 15:31:25,498]  WARN - LLMProviderService Attribute not found in the payload for identifier: $.usage.prompt_tokens
[2024-10-07 15:31:25,498]  WARN - LLMProviderService Attribute not found in the payload for identifier: $.usage.completion_tokens
[2024-10-07 15:31:25,498]  WARN - LLMProviderService Attribute not found in the payload for identifier: $.usage.total_tokens

Steps to Reproduce

  • Create, deploy and publish an AI API
  • Invoke the created API by navigating to the Developer portal and notice the aforementioned server logs

Affected Component

APIM

Version

4.4.0

Environment Details (with versions)

No response

Relevant Log Output

No response

Related Issues

No response

Suggested Labels

No response

ashera96 avatar Oct 07 '24 10:10 ashera96

Also, noticed the following error log in a scenario where the request was throttled out and restored after a minute; i.e. success API invocation (not sure if the same was logged before hitting the throttle limit). The scenario that was tested was a Mistral AI API's /v1/models resource.

[2024-10-07 15:57:54,599] ERROR - IfThenElseFunctionExecutor Exception on execution plan 'carbon.super_sub_New' on class 'org.wso2.siddhi.core.executor.function.IfThenElseFunctionExecutor', null
java.lang.NullPointerException: null
	at org.wso2.siddhi.core.query.selector.attribute.aggregator.SumAttributeAggregator$SumAttributeAggregatorLong.processAdd(SumAttributeAggregator.java:245) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.selector.attribute.aggregator.SumAttributeAggregator.processAdd(SumAttributeAggregator.java:71) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.selector.attribute.aggregator.AttributeAggregator.process(AttributeAggregator.java:86) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.selector.attribute.processor.executor.GroupByAggregationAttributeExecutor.execute(GroupByAggregationAttributeExecutor.java:121) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.executor.condition.compare.CompareConditionExpressionExecutor.execute(CompareConditionExpressionExecutor.java:38) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.executor.condition.compare.CompareConditionExpressionExecutor.execute(CompareConditionExpressionExecutor.java:25) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.executor.function.IfThenElseFunctionExecutor.execute(IfThenElseFunctionExecutor.java:98) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.executor.condition.BoolConditionExpressionExecutor.execute(BoolConditionExpressionExecutor.java:40) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.executor.condition.BoolConditionExpressionExecutor.execute(BoolConditionExpressionExecutor.java:26) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.executor.function.IfThenElseFunctionExecutor.execute(IfThenElseFunctionExecutor.java:103) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.executor.condition.BoolConditionExpressionExecutor.execute(BoolConditionExpressionExecutor.java:40) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.executor.condition.BoolConditionExpressionExecutor.execute(BoolConditionExpressionExecutor.java:26) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.selector.attribute.processor.AttributeProcessor.process(AttributeProcessor.java:38) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.selector.QuerySelector.processInBatchGroupBy(QuerySelector.java:224) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.selector.QuerySelector.process(QuerySelector.java:79) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.carbon.apimgt.throttling.siddhi.extension.ThrottleStreamProcessor.process(ThrottleStreamProcessor.java:175) ~[org.wso2.carbon.apimgt.throttling.siddhi.extension_9.30.32.jar:?]
	at org.wso2.siddhi.core.query.processor.stream.StreamProcessor.processEventChunk(StreamProcessor.java:45) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.processor.stream.AbstractStreamProcessor.process(AbstractStreamProcessor.java:104) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.input.stream.single.EntryValveProcessor.process(EntryValveProcessor.java:47) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.processor.filter.FilterProcessor.process(FilterProcessor.java:56) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.input.ProcessStreamReceiver.processAndClear(ProcessStreamReceiver.java:178) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.input.ProcessStreamReceiver.process(ProcessStreamReceiver.java:88) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.input.ProcessStreamReceiver.receive(ProcessStreamReceiver.java:113) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.StreamJunction.sendEvent(StreamJunction.java:128) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.StreamJunction$Publisher.send(StreamJunction.java:329) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.output.callback.InsertIntoStreamCallback.send(InsertIntoStreamCallback.java:52) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.output.ratelimit.OutputRateLimiter.sendToCallBacks(OutputRateLimiter.java:80) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.output.ratelimit.PassThroughOutputRateLimiter.process(PassThroughOutputRateLimiter.java:41) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.selector.QuerySelector.processNoGroupBy(QuerySelector.java:122) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.selector.QuerySelector.process(QuerySelector.java:87) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.input.ProcessStreamReceiver.processAndClear(ProcessStreamReceiver.java:178) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.input.ProcessStreamReceiver.process(ProcessStreamReceiver.java:88) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.input.ProcessStreamReceiver.receive(ProcessStreamReceiver.java:174) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.StreamJunction.sendData(StreamJunction.java:220) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.StreamJunction.access$200(StreamJunction.java:48) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.StreamJunction$Publisher.send(StreamJunction.java:349) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.input.InputDistributor.send(InputDistributor.java:49) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.input.InputEntryValve.send(InputEntryValve.java:59) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.input.InputHandler.send(InputHandler.java:52) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.carbon.event.processor.core.internal.listener.SiddhiInputEventDispatcher.sendEvent(SiddhiInputEventDispatcher.java:39) ~[?:?]
	at org.wso2.carbon.event.processor.core.internal.listener.AbstractSiddhiInputEventDispatcher.consumeEvent(AbstractSiddhiInputEventDispatcher.java:105) ~[?:?]
	at org.wso2.carbon.event.stream.core.internal.EventJunction.sendEvents(EventJunction.java:183) ~[?:?]
	at org.wso2.carbon.event.processor.core.internal.listener.SiddhiOutputStreamListener.receive(SiddhiOutputStreamListener.java:104) ~[?:?]
	at org.wso2.siddhi.core.stream.output.StreamCallback.receiveEvents(StreamCallback.java:99) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.output.StreamCallback.receive(StreamCallback.java:70) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.StreamJunction.sendEvent(StreamJunction.java:128) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.StreamJunction$Publisher.send(StreamJunction.java:329) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.output.callback.InsertIntoStreamCallback.send(InsertIntoStreamCallback.java:52) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.output.ratelimit.OutputRateLimiter.sendToCallBacks(OutputRateLimiter.java:80) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.output.ratelimit.PassThroughOutputRateLimiter.process(PassThroughOutputRateLimiter.java:41) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.selector.QuerySelector.processNoGroupBy(QuerySelector.java:122) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.selector.QuerySelector.process(QuerySelector.java:87) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.input.ProcessStreamReceiver.processAndClear(ProcessStreamReceiver.java:178) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.input.ProcessStreamReceiver.process(ProcessStreamReceiver.java:88) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.query.input.ProcessStreamReceiver.receive(ProcessStreamReceiver.java:174) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.StreamJunction.sendData(StreamJunction.java:220) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.StreamJunction.access$200(StreamJunction.java:48) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.StreamJunction$Publisher.send(StreamJunction.java:349) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.input.InputDistributor.send(InputDistributor.java:49) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.input.InputEntryValve.send(InputEntryValve.java:59) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.siddhi.core.stream.input.InputHandler.send(InputHandler.java:52) ~[siddhi-core_3.2.13.jar:?]
	at org.wso2.carbon.event.processor.core.internal.listener.SiddhiInputEventDispatcher.sendEvent(SiddhiInputEventDispatcher.java:39) ~[?:?]
	at org.wso2.carbon.event.processor.core.internal.listener.AbstractSiddhiInputEventDispatcher.consumeEvent(AbstractSiddhiInputEventDispatcher.java:105) ~[?:?]
	at org.wso2.carbon.event.stream.core.internal.EventJunction.sendEvent(EventJunction.java:146) ~[?:?]
	at org.wso2.carbon.event.receiver.core.internal.management.InputEventDispatcher.onEvent(InputEventDispatcher.java:27) ~[?:?]
	at org.wso2.carbon.event.receiver.core.internal.EventReceiver.sendEvent(EventReceiver.java:275) ~[?:?]
	at org.wso2.carbon.event.receiver.core.internal.EventReceiver.processTypedEvent(EventReceiver.java:238) ~[?:?]
	at org.wso2.carbon.event.receiver.core.internal.EventReceiver$TypedEventSubscription.onEvent(EventReceiver.java:335) ~[?:?]
	at org.wso2.carbon.event.input.adapter.core.internal.InputAdapterRuntime.onEvent(InputAdapterRuntime.java:110) ~[?:?]
	at org.wso2.carbon.event.input.adapter.wso2event.internal.ds.WSO2EventAdapterServiceDS$1.receive(WSO2EventAdapterServiceDS.java:100) ~[?:?]
	at org.wso2.carbon.databridge.core.internal.queue.QueueWorker.run(QueueWorker.java:81) ~[?:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
	at java.lang.Thread.run(Thread.java:829) ~[?:?]

ashera96 avatar Oct 07 '24 11:10 ashera96

@ashera96 The first 3 WARN lines are expected as you haven't provided a separate keystores to genarate API Key. The second set of WARNs have been fixed from the above PR

AnuGayan avatar Oct 08 '24 03:10 AnuGayan