BindToItems ErrorInternalServerTransientError on 251'st item - exchange-server

My issue is essentially the same as this one. However, I have a temporary work-around, but would like some ideas about how to resolve the underlying issue in a simple robust manner.
I'd been calling SyncFolderItems with the maximum allowed value of 512 items.
This worked fine. However, calling BindToItems with the full collection of item IDs returned from SyncFolderItems was showing the 251'st item as having failed with ErrorInternalServerTransientError. All the other items, 0..249, and 251..511 were fine.
Examining event logs showed this from Exchange:
Mapi session "snipped" exceeded the maximum of 250 objects of type "objtMessage".
It seems odd that EWS managed to get the other items OK - I'd have expected everything after 250 to have failed, but anyhow...
My immediate workaround is to substantially reduce the number of items that I ask for from SyncFolderItems. However I think that side-steps the issue since the Exchange setting is configurable, and could be set less than the value I choose.
Given that it's more efficient not to discard the whole batch of items I've got, how do you code around this scenario - given that the updated SyncState from SyncFolderItems will include the item that's failed?

Related

HTTP500 error LoadRunner Oracle NCA script

I have recorded a script from login till the opening of Oracle form.
Then i split the program into two parts, one with login and other as Navigation to form and open.
Login is successfully executing but the navigation script is giving me an error HTTP-error code 500
T03_Amar_Navigation.c(95): Error -26612: HTTP Status-Code=500 (Internal Server Error) for the URL [MsgId: MERR-26612].
there is no problem while logging in and opening oracle form manually.
can someone help me what I may be missing?
I tried copying all the correlation parameters into the navigation as well, no error or mismatch with correlation parameters
Best guess, based upon seeing this 500 condition hundreds of times in my career, is that you need to check your script for the following
Explicit checking for success on each step, or expected results. This is more than just accepting an HTTP 200. This involves actually processing the content that is returned and objectively looking at the page for elements you expect to be present. If they are not present then you will want to branch your code and elegantly exit your iteration. A majority of 500 level events are simply the result of poor testing practices and not checking for expected results.
Very carefully examine your code for unhandled dynamic elements. These could be related to session, state, time or a variable related to user/business process. A mishandled or unhandled dynamic element cascading for just a few pages results in an an application where the data being submitted does match the actual state of the business process. As this condition is something that would not be possible with the actual website, you wind up with an unaddressed exception in the code and a 500 pushed back to the user. There are roughly half a dozen methods for examining your requests for dynamic elements. I find the most powerful to be the oldest, simply record the application twice for the same data, then compare the scripts. Once you have addressed the items related to session, state and time, then record with a different data set (user, account, etc...) and look at the dynamic elements related to your actual data in use.
Address the two items above and your 500 will quite likely go away.

Exchange Server. Move Item operation. How to map new items to the moved ones?

In my mail app I'm moving messages between folders by using MoveItem operation. When you move messages their ids are changed. In the response I'm receiving the new message ids. But the old ones are missing. And this is a big problem.
I have no idea how to map a new message id to an old one and can't update messages in my database with the new ids. Seems like I don't understand something simple. What's the point of returning new ids if you have no idea what message each one belongs to?
Am I supposed to rely on the order of response messages? If so can you please give me a link to the corresponding piece of EWS documentation?
Or am I supposed to perform synchronization of mailboxes every time I move more than one message?
When you used MoveItems you would have passed in an array of ItemId's and what you get back as a result is an Array of objects.
The order of the items in the Response collection matches the order in your request so element 1 of the response represents the results of the element 1 request. So you can just map them this way.
However your response logic should be more complex to deal with issues where half of your request being executed okay while x% failed because of throttling etc (so check the response status of each request) or getting a 501 mid move where you could get into an unknown state.

Mailchimp members activity

I've got some kind of script. Goal is:
Get Mailchimp Lists
For each list get members
For each member get activity
Store it
Does anyone know - if there any way to not use one API call for each member to get his activity?
I've got around 28 000 members.
28 000 API calls - seems as bad as it can be.
I've tried to get Lists Activity, but no way, it is always empty. So I really have to get exactly members activity.
I'm currently attempting to do something very similar and there is a workaround, although I am not sure how feasible it is. Basically, you can do it through reports, email activity:
http://developer.mailchimp.com/documentation/mailchimp/reference/reports/email-activity/
The challenge here will be that you will try to pull 28.000+ records at a time, therefore it will take a long time. From my brief calculations it can take up to 1 minute per 1000 records (you will need to loop through 1000 records at a time, otherwise it will most likely time out).
The larger problem is maintaining this 'database', if you have activity constantly happening (i.e. opens/clicks/bounces) then you will need to pull the whole campaign activity again and update wherever you store it. I've been trying to find a workaround with no success. You could use the 'since=2017-10-07T00:00:00+00:00' parameter, however it still returns a blank list when there is no activity unfortunately. If only 1000 members are actually active, it will return 27.000 rows of no activity. It would be great if there would be another parameter we could potentially apply to return only emails where there was an action.
Please let me know if you find a better solution.
P.S. - it might be worth reaching out to mailchimp support for this
Update - you can use the Mailchimp Export api: https://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-the-export-api/ and extract the email activity. I had huge issues unpacking it, please follow the links below: Decode text response from API in Python 3.6 and Separate pd DataFrame Rows that are dictionaries into columns . Let me know if you have any other questions.

Google Calendar API : event update with the Ruby gem

I'm using https://github.com/google/google-api-ruby-client to connect to different google API in particular the Google Calendar one.
Creating an event, updating it and deleting it works most of the time with what one can usually find around.
The issue appears when one tries to update an event details after a previous update of the dates of the event.
In that case, the id provided is not enough and the request fails with an error :
SmhwCalendar::GoogleServiceException: Invalid sequence value. 400
Yet the documentation does not mention such things : https://developers.google.com/google-apps/calendar/v3/reference/calendars/update
The event documentation does describe the sequence attribute without saying much : https://developers.google.com/google-apps/calendar/v3/reference/events/update
What's needed to update an event ?
Is there specific attributes to keep track of when creating, updating events besides the event id ?
how is the ruby google api client handling those ?
I think my answer from Cannot Decrease the Sequence Number of an Event applies here too.
Sequence number must not decrease (and if you don't supply it, it's the same as if you supplied 0) + some operations (such as time changes) will bump the sequence number. Make sure to always work on the most recent copy of the event (the one that was provided in the response).
#luc answer is pretty correct yet here are some details.
Google API documentation is unclear about this (https://developers.google.com/google-apps/calendar/v3/reference/events/update).
You should consider that the first response contains a sequence number of 0.
The first update should contain that sequence number (alongside the title, and description etc ). The response to that request will contain an increment sequence number (1 in this case) that you should store and reuse on the next update.
While the first update would imply a sequence number of 0 (and work) if you don't pass any the second might still pass but the third will probably not (because it's expecting 1 as sequence).
So that attribute might appear optional but it is actually not at all optional.

Under what circumstances can a Magento Order Increment ID have duplicates?

I've been running into some odd problems of late with a Magento installation (1.4.2.0), whereby the same order increment ID is being reused for more than one order.
Screenshot
As you can see in the screenshot above, a full 45 minutes pass before the same customer makes a second order with different products and total value, only to have the increment ID reused.
This also happens occasionally where the orders are a couple of minutes apart, which could possibly be from a double submission on a payment gateway causing two callbacks to Magento.
I'm keen to get some insight on how these things could happen, as I would expect each order to be given a unique ID - under what circumstances can we get duplicate order increment IDs?
My first guess would be there's a third party extension, core hack, or maybe even core code, that isn't handling operations with the Order objects transactionally. That, combined with an unexpected exceptions somewhere between saving an order and the internal increment number being increased, could result in orders with the same number being created. I'd check your Error and Exception logs for problems, clean those problems up, and see if the problem continues.
Otherwise you're going to need to reproduce the conditions of the errors in a test environment and debug debug debug.

Resources