Connector Error - Deleting excess AWS purchases

Modified on Thu, 24 Nov 2022 at 03:16 PM

What is happening?

We will start with some context, provided by none other than the goat himself, Roelof Spijker:


De AWS Connector werkt door Cost & Usage Reports (CUR) uit te lezen. Deze rapporten worden meerere keren per dag "gegenereerd door Amazon en in een S3 bucket gezet. Ieder rapport bevat informatie voor de volledige maand tot dat moment. Wanneer de connector draait kijkt hij welk rapport het nieuwst is en verwerkt hij dat rapport. In dat rapport zit dus (als het goed is) al het verbruik dat er in het vorige rapport voor die periode zat, plus een klein beetje meer dat in de tussentijd verbruikt is. Het probleem is dat individuele records in die rapporten geen uniek id hebben. Er is dus geen manier om te achterhalen welke regels in het rapport overeenkomen met regels in het vorige rapport. Dat is wel nodig, want we moeten besluiten of we een vorige aankoop moeten updaten (vervangen) of dat dit om compleet nieuw verbruik gaat en we dus een nieuwe aankoop moeten maken.
Om dat alsnog te kunnen doen maakt de connector "volgnummers" aan per account. Hij begint voor iedere account met tellen bij 1 en ieder volgend record verhoogd het nummer. Op basis daarvan worden PurchaseReferences gemaakt voor de aankopen in de vorm "periode-masterAccountId-accountId-volgnummer" in het voorbeeld dus iets als "202211-399797375561-730007615811-0000001". Dat gaat prima, mits er in ieder opvolgend rapport meer records zitten dan in het rapport ervoor. Als we ooit een rapport zien dat minder records bevat dan het vorige rapport, dan is dat een probleem. Dan zijn er immers aankopen die we gisteren hebben gemaakt maar die nu niet overschreven worden en effectief niet meer overeenkomen met verbruik in het CUR."


When this happens, CloudBilling generates the following error:


Last report generated more results (11552) than current report (9541) for prefix 202211-664884876168-226780461708, manual intervention required to clean up excess


How can we (or the customer) fix it?

The excess items need to either be deleted or overridden. The latter happens when the total number of items in a new report exceeds the number of items in the report preceding the current one. So, sticking with the example above, this would happen if a new report has more than 11552 items. However, we cannot be certain that this will happen. The only way to be certain that the invoice will not contain excess items is by deleting them. To do this, you need to take the following steps:

  1. In the connector Activity result with the error message, select the entire prefix (6 numbers-12 numbers-12 numbers) and copy it.
  2. Go to Purchases and paste the prefix in the Purchase Reference field (don’t click any of the dropdown options!)
  3. I would recommend clicking 'search' at this point, to check the imported date of the most current purchases
  4. Next, in the ‘Imported Date To’ field (don't select the wrong one), select the date directly after the connector run with the error, at 00:00:00. After searching, the imported dates should precede those of current purchases
  5. Check a few of the purchase references. The last number should be higher than the second number mentioned in the connector error.
  6. Select all of these purchases and delete them


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article