Symptoms

The following task is failed:

Task name: "Execute operation '/periodic_task' with ID XXXXX on resource YYYYY"

Task description: create_invoices.


Task is failed with an error

'500 Internal Server Error' received from 'POST https://10.10.2.80:11443/aps/partners/ha463137-ec80-4257-b8e7-e26255a4ef2e/periodic_task?task_name=create_invoices&process_id=6fc2571a-f1f8-49a0-816c-399db92c02b7': 

azure-nce.log shows that 2 invoices were received by the application, one of them is a "usage" invoice with 0 usage

2021-04-15 17:09:07,514 DEBUG [com.odin.azure.api.PartnerCenterApi$Slf4JLogger] ( pool-2-thread-84) <PCSDK> The request: 'GET https://api.partnercenter.microsoft.com/v1/invoices?filter=%7B%22value%22%3A%222021-03-01%22%2C%22field%22%3A%22InvoiceDate%22%2C%22fieldType%22%3A%22String%22%2C%22operator%22%3A%22GreaterThanOrEquals%22%7D' has been completed: '200'

header:
 <snipped>
 2021-04-15 17:09:07,515 TRACE [com.odin.azure.api.PartnerCenterApi$Slf4JLogger] ( pool-2-thread-84) <PCSDK> body:
 {"totalCount":2,"items":[{"id":"G003667297","invoiceDate":"2021-03-09T23:57:10.7200715Z","billingPeriodStartDate":"2021-02-01T00:00:00Z","billingPeriodEndDate":"2021-02-28T23:59:59.9999999Z","totalCharges":0.0,"paidAmount":0.0,"currencyCode":"EUR","currencySymbol":"€","pdfDownloadLink":"/invoices/G003667297/documents/statement","invoiceDetails":

and "create_invoice" task was failed after the invoices were received

 2021-04-15 17:09:07,579 ERROR [com.odin.azure.common.ExceptionsCollection] ( pool-2-thread-84) Executing periodic task 'create_invoices' was failed
 java.lang.NullPointerException: null
 at com.odin.azure.model.BillingCost.fillInvoiceParameters(BillingCost.java:576) 



Cause

Software related issue APSA-23570 "Azure NCE create_invoice task failed".

One of the invoices contained zero usage and "invoiceDate" value was in the future from the "last_invoiced_month" value

[{"last_invoiced_month":"2021-01-01T00:00:00Z",
"aps":{"modified":"2021-04-15T05:03:18Z","id":"0d08f49a-8bae-4e9c-b83c-06461320c098","subscription":"cd886a6d-a13d-427f-be72-808485925bf5","type":"http://www.odin.com/app/azure-csp-modern/subscription/1.3","status":"aps:ready","revision":126}}]

As a result, invoices were filtered out by the application.


Resolution

The issue has been fixed in Azure NCE 1.6. Please consider the application upgrade accordingly.


Internal