LinkShare Merchandiser API web service throws error 7187145 (FSW server connection) - affiliate

I started an app using the LinkShare Merchandiser Query API and queries against it were working just fine. I was able to run queries via IE, my app or Yahoo Pipes (the approach I settled on - feed my app from the service via Yahoo Pipes).
After a week or two of using this service while developing my app, it started to randomly return errors about 1 in 5 queries, always after what it seemed to be a timeout (response took 5+ sec). Now that I'm resuming the project after a 2-week hiatus, the query does not work at all. Not even once.
The error is always the same, same as what used to be when it randomly failed. It seemed (and still seems) to me that it is an internal problem on their side but I can't believe it has been (and is) broken 100% of the time for the past 48h.
Any query fails. A sample:
http://productsearch.linksynergy.com/productsearch?token=**token**&keyword="DVD+Player"&cat="Electronics"&MaxResults=20
And its response:
<?xml version="1.0" encoding="UTF-8"?>
<result>
<Errors>
<ErrorID>7187145</ErrorID>
<ErrorText>Internal error 18171650 occurred: FSW server connection.</ErrorText>
</Errors>
</result>
There is no documentation, cannot find any mentions of this on the web and have received no response from them as of yet. I'm not sure where to go from this at this point.
Ideas? Experiences? Should I dump this approach and start anew with a different provider? Any input will be appreciated.

Related

Googel App Engine: Intermittent Issue: Process terminated because the request deadline was exceeded. (Error code 123)

Problem you have encountered: I have deployed a spring boot application (backend) on Google App Engine. For past few days, I am getting below mentioned error intermittently:
Error: Process terminated because the request deadline was exceeded. (Error code 123)
Description:
I have deployed a spring boot application (backend) on Google App Engine.
For past few days, I am getting below mentioned error intermittently:
Error: Process terminated because the request deadline was exceeded. (Error code 123)
The application uses CloudSQL (MySQL) database. I have setup below mentioned auto-scale properties as well:
<sessions-enabled>true</sessions-enabled>
<warmup-requests-enabled>true</warmup-requests-enabled>
<instance-class>F2</instance-class>
<automatic-scaling>
<target-cpu-utilization>0.65</target-cpu-utilization>
<min-instances>10</min-instances>
<max-instances>20</max-instances>
<min-idle-instances>5</min-idle-instances>
<max-idle-instances>6</max-idle-instances>
<min-pending-latency>30ms</min-pending-latency>
<max-pending-latency>500ms</max-pending-latency>
<max-concurrent-requests>10</max-concurrent-requests>
</automatic-scaling>
<inbound-services>
<service>warmup</service>
</inbound-services>
What you expected to happen: The application hosted on GAE shouldn't fail with this intermittent error
Steps to reproduce: No steps available, its intermittent.
Other information (workarounds you have tried, documentation consulted, etc): I have tried multiple different combinations for the configurations of autoscaling, etc.
I just hat the exact same issue in a GAE Standard Java 8 Application - after A LOT of trial and error I found the issue was related to Cloud SQL - one symptom was that autoscaled instances restarted (probably crashed) frequently as if there was something stuck. The "Error: Process terminated because the request deadline was exceeded. (Error code 123)" also produced no further logs.
The solution (in our case) was (because that was the only thing we changed right before the error appeared all the time) that we frequently used a Cloud SQL Query in our application that went like this:
case when column=1 then 1 else -1 end
column could be NULL in some (rare) cases - no problem with our normal SQL client we tested this with, but for some weird reason, Cloud SQL and JDBC has a problem with this causing these instance issue
changing to
case when coalesce(column,0)=1 then 1 else -1 end
so that the there would never be a comparison against NULL in the case statement solved the problem

NullPointerException with JDBC and App Engine

I have been struggling with a problem in Google App Engine, using Java, for several days.
Many times (about 50% of the time) when I try to request the connection to a Cloud Sql instance, the connection returns a null value, resulting in several NullPointerException messages when trying to invoke Cloud Sql queries (when invoking .prepareCall(stored_proc)).
I have the latest App Engine Java SDK, in a project service, shared with other services built in Python which consume this Java backend.
Could it be possible that after certain time the instance/s could crash (I am just testing at this point, so I am using default scalation)?
This is the code that returns null:
Class.forName("com.mysql.jdbc.GoogleDriver");
url = "jdbc:google:mysql://project:instance/database?user=root";
log.info(url);
return DriverManager.getConnection(url);
This is part of my configuration file:
<application>app</application>
<module>mod</module>
<version>1</version>
<threadsafe>true</threadsafe>
<use-google-connector-j>true</use-google-connector-j>
I tried several suggestions from other posts, but with no success at all.
Any suggestion will be welcome, thanks in advance.
I was facing the same problem while using Google Cloud SQL and App engine.
I solved the problem by managing the connection pool my self. I realised that when you request a new connection for each request and close it on completion of the thread. The other requests would get back a null resulting to NullPointException.
I decided to do the following and it work for me for like 2 years now.
Open a connection and keep it to a static class that has a number of connections;
Every time i want to find a connection to the database, i would first check if the is an available connection for me to use.
Incase a Query killed the connection, thus means i needed to request another extra connection just to for the sack of connection drops.
I will add this as an answer, since it is not exactly what Chrispinus mentioned, although he gave me a good idea for teh solution.
I went deeper in the code and found that some of the methods were not closing the database connection. I had assumed all of them were doing that, but looking at each method, I found I was wrong.
So, although it sounds obvious, check connections are being closed (or managed, as Chrispinus says) properly.

Getting http error 500 access denied from web api

Background: I am working on a product which is built using AngularJS in the front-end, and Microsoft Web Api in the back-end. The website is hosted on a Windows Server 2012 machine running IIS. We are using Windows authentication to connect to the machine.
The problem: Calling various API methods work flawlessly for me and the majority of users. But for some of the users, they cant perform certain API calls. Most of the endpoints work and return valid data, but a few methods never even gets reached.
This is the error in the iislog: 2016-05-26 12:25:23 xx.xx.xxx.xx POST /api/controller/method - 80 domain\user xx.xx.x.xx Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.1;+WOW64;+Trident/6.0) http://xxxxxx.com/#/Pagename 500 0 0 514
In the console in google chrome it says: Error: Access denied.
I have set the api to log all exceptions to a database, and no error is shown. So my theory is that the api doesnt even get reached when trying to perform these specific http methods.
I have tried searching for answers, but without any luck. Does anyone have any idea?
I finally found a solution to my problem, the exception being thrown was a DbEntityValidationException. It was thrown because some of the users names were too long to be inserted into the database table. It was not catched and properly displayed by my own general exception handling. I had to follow this guide to get the proper exception logged:
https://stackoverflow.com/a/6258174/3592773
Thanks for all the help and I hope this might help someone else in the future.

Getting 403 not authorized when indexing documents on Retrieve and Rank

I am suddenly getting a 403 error when I try to POST an update to the Retrieve and Rank service. This code is under development but it has been working up until yesterday. The failure occurs only when doing a POST to /v1/solr_clusters/{solr_cluster_id}/solr/{collection_name}/update, and it fails the same way whether I do it via my program, the Swagger API documentation, or cURL. All other operations to this service that I've tried work fine when using the same credentials that I'm using with this POST. The error message I'm getting back is
Error: WRRCSH004: Service [1d111267-76b7-417a-98bd-4e9a58072ef9] is not authorized for cluster [sc262b05e8_dcf5_40b4_b662_ae85058ff07f]!. I don't know where the identifier (1d111267-76b7-417a-98bd-4e9a58072ef9) is coming from; that's not the userid I'm sending in.
Looking into your issue it appears your Bluemix organization has multiple service instances. The 403 issue you were seeing is because you're trying to access a Solr cluster using credentials from one of your instances against a cluster in the other instance. The 1d111267-76b7-417a-98bd-4e9a58072ef9 represents one of these service instances—but the issue is that the cluster you're trying to access is not part of that instance. A good way to test this is to ensure you're using the same credentials that generate the 403 but simply try to list the Solr clusters you have created by doing a GET against https://gateway.watsonplatform.net/retrieve-and-rank/api/v1/solr_clusters/.
As for the 500 issue, I wasn't able to see anything on our end. If you're still experiencing that I would suggest posting another question and we can look into things again.
Thanks,
-Scott

getLastAccessedTime() in GWT sessions returns 0

I'm trying to add timeouts to GWT sessions, by using the following code to check if a session is alive:
public boolean isSessionAlive() {
return System.currentTimeMillis() - getThreadLocalRequest().getSession()
.getLastAccessedTime() < timeout;
}
I based this code on many examples I saw on web for GWT sessions, such as this.
The above code works great while running on a local web server, but after deploying the project to App Engine it doesn't. The following always returns 0 on App Engine:
getThreadLocalRequest().getSession().getLastAccessedTime()
As far as I understand, the last accessed time is updated on each RPC call.
I made several calls, but this value still remains zero and incorrect result is returned.
Does anybody know how to fix this issue?
Things will change after deployed on GAE
Just today attended the session on app engine by #roman irani .
remember that App Engine is a distributed architecture so a difference from Java EE is that you are never guaranteed the same application server instance during request processing as the previous request. While the object is being serialized correctly in memcache, you still have to call setAttribute() every time due to the fact that memory is not shared.
Clear cut picture here to handle the session
I have found a workaround. Adding the following code in war/WEB-INF/web.xml will cause the session to expire after 30 minutes:
<!-- timeout in minutes -->
<session-config>
<session-timeout>30</session-timeout>
</session-config>
Reference: Session Timeouts with GWT RPC calls.

Resources