Facebook Conversions API - Invalid Timestamp errors - facebook

I am receiving a handful of errors regarding the event timestamp. I have confirmed that I am sending a UNIX timestamp in seconds. This is what I have implemented in the front-end of our code to get the UNIX timestamp in seconds: Math.round(Date.now() / 1000)
Also, it looks like less then 1% of the events are affected for each event created, so that's why I'm a bit confused and not sure how to resolve these errors.
Error message:
The timestamp for the InitiateCheckout events sent from your server is in the future. Timestamps are metadata sent alongside each event you send from your server and they represent the time of day when an event actually occurred. For example: the time that a customer made a purchase on your website. All timestamps should represent a point in time that occurred within the last 7 days"
Click here to see a screenshot of the errors
Has anyone encountered these type of errors? If so, any advice on how to resolve them?
I am not sure how to go about this

Related

Algolia Insight Library - timestamp must not be in the future

Under insights api logs, some events are failed to log with 422 error code and in details it says "timestamp must not be in the future",Insights library is configured like below in Android application
Insights.Configuration configuration =
new Insights.Configuration(5000, 5000, userToken);
Insights insights = Insights.register(GoldenScentApp.getAppContext(), AppConstants.ALGOLIA_APP_ID,
AppConstants.ALGOLIA_KEY, indexName, configuration);
insights.setMinBatchSize(1);
The event was logged with time GMT: Monday, 31 May 2021 06:03:07.048 but the time in Algolia Received at:2021-05-31T06:01:13.859Z
This problem is with algolia sdk. They send old event every time new event send. Like user click event it goes in to local db. Once 10 events limit reach they send event. So in case user send 9 event in one session; then open app after 4 day when another event log algolia will send other events too. But timestamp will be older so they log as error in algolia.
work around : Solution: Set event flushDelay to 5 sec instead of 30 second which in documentation mention as 30 min(idk why).

SlashDB error: 'ResultProxy' object has no attribute 'execution_options'

I have a SlashDB installation on top of MySQL. Once in a while, especially after a period of time of inactivity, the first call to an API returns:
'ResultProxy' object has no attribute 'execution_options'
The second request (same endpoint) would work normally.
My guess was that SlashDB's connection to MySQL had been terminated due to inactivity. I set the wait_timeout system variable (MySQL) to about 10 hours and it seems to help in some cases.
What does this error mean, and is there a way to prevent it?
This should no longer occur in version 1.0, but in case you still have a problem please post a dump of your database schema with your question.

Get inbox messages from a date onwards

Using the Graph API Explorer, and using GET /me/inbox, I can get a list of messages.
I was wondering how to limit them to messages from the past day, for example?
You can use time based paging this way:
me/inbox?since=1372395600
It relies on the updated_time (unix timestamp) parameter of an inbox thread. This way you could get all the threads updated with a message at a time since yesterday, for example.

SqlBulkCopy unusual TimeOut Error

I have a SqlBulkCopy operation that is taking data from an MS-Access 2007 database (via OleDbConnection) and using SqlBulkCopy to transfer that data to a SQL Server database. This has previously been working and continues to work for one MS-Access database, but not the other.
I get the error message:
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
It is hard to believe it is a timeout ast the oledbCommand.CommandTimeout = 0 the sqlBulkCopy.BulkCopyTimeout = 0 and on either side (MS-Access and SQL Server the timeouts have now been set to 0).
Are there other issues/exceptions that the above error message could be hiding? Is there a way to determine what the base cause of a sqlBulkCopy.WriteToServer exception is (there doesn't appear to be any inner exceptions etc...)
So the issue was that there were dates being transfered and some of those dates were invalid for SQL, but valid in Access. For whatever reason this was presenting as a Timeout rather than "invalid date/time" - though if you reduce the data being transfered to a handful of rows (200) rather than the full transfer (500,000) it reports as invalid date/time ... curious.

"JSONValue failed" Error while fetching data from server into iPhone

I am fetching data from server into my iPhone app.
For fetching data from server, I am using HTTP Post method and for parsing data obtained I am using SBJSON Parser.
When the first time my app launches, the data is not fetched.
It shows the following failure log in Console. The app does not crash but just that data is not fetched.
<html>Your request timed out.
Please retry the request. </html>
2011-04-21 08:39:06.339 Hive[1594:207] -JSONValue failed. Error trace is: (
"Error Domain=org.brautaset.JSON.ErrorDomain Code=3 \"Unrecognised leading character\" UserInfo=0x4cabe90 {NSLocalizedDescription=Unrecognised leading character}"
)
The app fetches data properly from the second time onwards. It only gives this error when the app runs the first time.
What could be wrong?
Without analysis of the server and its resources it is difficult to determine why the server is taking too long to respond.
One thing to think about is how much time occurs between the last time you make the JSON attempt and the next time you make your "first attempt". Maybe then see if you an recreate it using a web browser.
Is the server a production quality server? If not, it may be "spinning up" to answer the first request which takes too long for the first response.
Personally, I wrote a generic JSON feed class that has a failure retry option. If it receives nothing or invalid JSON, it will retry x times at y seconds intervals based on what you pass it. It takes a little more work initially but it will payoff for two reasons.
1) It can be reused over and over and an update, like using ASIHTTRequest like Terente's good suggestion can be made in a single file.
2) While you may not expect a response to fail, server slowness or network issues can occur causing a flawed response.
You could use ASIHTTRequest and if you get an time out try to make an new request to the server.