4 Replies Latest reply on Aug 6, 2012 10:51 AM by steve.winter

    CWP Error 22 in FM12 migrated solution


      Hi all


      I've had a solution running using CWP for a number of years with no issues. A couple of weeks ago the client decided to go with v12 - at the time we had a few issues, but overall things seemed to have gone well enough.


      In the last week, they've noticed that a web service which outputs data about courses to another system has been periodically failing. I increased the logging and have found that about 25% of the time an identical call to the same CWP code will fail. This is the error which comes back;


      Error code: 22

      Error message: Communication Error: (22) The requested URL returned error: 401 - This can be due to an invalid username or password, or if the FMPHP privilege is not enabled for that user.


      Now I know that (frankly) this is complete rubbish, because I know from the logged command that the username and password are the same, and that the FMPHP privilege is enabled for that user because a few sec (min, hours) before that log entry and a few sec (min, hours) after that log entry the same credentials have been used to access the same database successfully...!




      In my log from the last 72 hours, I see 2159 requests logged of which 1663 loaded fine, the other 496 (so about 23%) gave the above error...


      Anyone else seen this happening in FM12...? ever seen it happen in previous versions...? got any ideas...??




        • 1. Re: CWP Error 22 in FM12 migrated solution

          Just a stab in the dark ... timeout?



          • 2. Re: CWP Error 22 in FM12 migrated solution

            Thanks Mike


            Timeout between the web publishing core, and the FM engine itself - I guess that's possible, but this is a high-spec single machine install...


            How would I go about determining if that was the case...?

            • 3. Re: CWP Error 22 in FM12 migrated solution

              Good question. Short answer: I don't know.   


              Longer answer: Try looking at the Admin Console and see if you have unusually high Wait Time / Call numbers. That might be a clue.



              • 4. Re: CWP Error 22 in FM12 migrated solution

                More digging, more logging, more weirdness...!!


                I've now got this;


                     $titleData = findProduct($requestData[1]);


                     // we're going to try again, straight away, if it breaks

                     if(FileMaker::isError($titleData)) {

                           $titleData = findProduct($requestData[1]);



                So basically, try and load the data from teh DB - if that fails, try again, immediately... as a result, the failure rate has dropped significantly, since I've got approx.;

                     0.25 * 0.25 = 0.06

                or a 6% chance that it will fail, given that I was seeing about 25% of the requests fail previously...


                But frankly, this is rediculous...!


                I've tried digging into timeouts, but at the time that these issues are occuring I'm seeing server connections around 20 - 30 - a mix of FM Client, IWP, XML and PHP API combined (so that's a total of 30, not 30 of each)...  the server is a Quad core box with 4Gb of RAM, CPU usage 'spikes' at about 30%...


                Any other thoughts anyone...?