Reason for Error Timeout in CouchDB - ios

I'm using CouchDB for my iOS application.
Following is my Application flow,
When my application is launched for the first time it replicates the remote database using xyz:a...#mmm.iriscouch.com/databasename.
if the replication is successful, everything works as expected, but sometimes the replication is not successful. In that case I'm getting the following error with log
1> OTHER: {'EXIT',{error,timeout,#Ref<0.0.0.506>}}
and it doesn't replicate until i remove the application and freshly reinstall the application on the device/simulator.
is there any callback/delegate to handle this?
Somehow when I try synching with empty DB then I never get Error time out, once I have content in DB I get the error!
Also it is hard to replicate on simulator, whereas on iPad occurrence is 90%.
i have placed the sample project in git hub
https://github.com/interactiveblueprints/CouchDBSyncTest (for couchDB username password, please read readme.txt)
this sample code is just modification of PhotoLocations. An example application (https://github.com/couchbaselabs/iOS-Demo-PhotoLocations), But changed as per my requirement.
I have also attached the error logs in
http://dl.dropbox.com/u/35814355/ErrorLog.rtf
Waiting for reply,
Krishna.

I have tried with your sample and updated the "Couchbase.framework" to the latest one, from https://github.com/couchbaselabs/CouchCocoa and now the problem seems to be solved, may be this was a bug in previous version. now it seems the DB tries to restart by itself. and the replication feels more smoother and faster.

Related

"failed to get context" error against real server, works fine with mockserver

Following the ODATA V4 tutorial in step 2: app runs against mockserver, tips are given to run it against a real server. Used the existing index.html as test/mockServer.html and created a new index.html, pointing to ComponentSupport for oninit. Added cors-anywhere and adjusted the manifest. Works well, both mockserver and real.
That was in step 2 and the app worked fine also against a real server. Fast-forward to step 5 and I notice the app fails to load any data when running against a real server. Long story short, the backend is throwing an error, not even "count" together with "top" is accepted. I checked the docs for ODATA, "count" does not seem to be an exclusive option.
Am I fundamentally misunderstanding the way ODATA works? I am especially puzzled by the fact that the mockserver runs fine.
EDIT: created bugreport
As reported in the closing comment of my bugreport, Microsoft has confirmed the issue: "This was due to an error in the version of the OData WebAPI library we were using in the backing service. I have an update with various fixes, including updating to the latest WebAPI library that contains this fix, that I just haven't pushed out to production yet. Let me see when if I can get that deployed."

SonarQube Service Starts, Runs and then Stops?

I have a Windows 2012 R2 server and I managed to install the SonarQube 5.4 server as a Windows Service. I also set up a user so the service can actually start without the infamous "It started then stopped" error a lot of people seem to get. Before installing the server as a windows service, I checked that it worked using StartSonar.bat and it did work just fine, so I was confident when I made it into a service.
But when I try to access http://localhost:9000 there is nothing there, and it appears that shortly after starting the service it stops without any message at all. I can't tell if this is because I try to access the site (which gives me ERR_EMPTY_RESPONSEin Google Chrome) or if it just closes down after a short while.
Anyone got any insight?
I'm a beginner. I came across the same issue and fixed it.
Ensure that the database is running.
My log file (located at sonarqube_home_dir/logs/sonar.log) included the following statement.
Caused by: org.h2.jdbc.JdbcSQLException: Wrong user name or password [28000-176]
Since I'm using the default database, I commented below lines
#sonar.jdbc.username=***
#sonar.jdbc.password=***
at sonarqube_home_dir/conf/sonar.properties.
This must happen due to many reasons like connection problems, permission problems so First, you have to see the logs. /sonarqube-7.6/logs$ tailf sonar.log. then you can find the reason. Once I had the same problem so I did like that. my error is something Directory does not exist: lib/jdbc/mysql
org.sonar.process.MessageException: Directory does not exist: lib/jdbc/mysql reason is I uninstall MySQL and remove all folders name contains "MySQL".
just check whether port 9001 already in used, stop it if already in used.

How to prevent load of meteor.local (when building ios app with phonegap)

This is an extension of a question I asked here, which went unanswered. I am attempting to use the Meteor app on my iPad that I'm hosting on my own remote server. The issue is that when I run the following command, the app builds successfully:
sudo meteor run ios-device --mobile-server=XXXX:XXXX
The problem begins when I click the build button in Xcode to deploy the app to my device. It seems to build everything OK and even load the data from my remote server. But after a few seconds, it reverts back to a local database/build. When I check the Xcode log, it says "Finished load of http://meteor.local/" so it seems to be overwriting the remote data with new, local data. I'm not sure if I have something enabled that's causing Xcode to load a local database or if there's something that I have to turn off to prevent it from loading.
UPDATE:
I've resolved the issue using the suggestion from Jey DWork to apply the missing environment variables in the Meteor server startup.
The ones I added were:
Meteor.absoluteUrl.defaultOptions.rootUrl
process.env.ROOT_URL
process.env.MOBILE_ROOT_URL
process.env.MOBILE_DDP_URL
Without setting these, the ROOT_URL seemed to be getting overwritten after the initial load. As these environment variables do not seem to be documented, I'm still going to search and see if there is a different solution to this issue (as it seems strange that the app would have to re-load itself multiple times before it's usable). For now though, this is a temporary solution.
Have a look at this post :
I've understood my problem, maybe your problem is the same, all explanations here : stackoverflow.com/questions/34658956/
Your app for smartphone must be built with --server=http://IP:PORT parameters
And
Your app for server must be started with --mobile-server http://IP:PORT parameters

Service Not Responding - Error 1053

The program starts correctly if I double-click it or if I debug it from VS2010, but it doesn't respond when I try running it from Services.msc. It used to work just fine, but I tried to un-register and then re-register the service to fix a different bug and now I get the following error:
Could not start the PFAdapterMng service on Local Computer.
Error 1053: The service did not respond to the start or control request in a timely fashion.
I tried putting logs at the beginning of main(), and I found out that the service stops responding before it even gets there.
I've tried using Procmon to figure out if there's some registry key missing, but I couldn't find any problems through Procmon.
I've also tried re-registering the service to try to fix it, since re-registering the service was what caused the error in the first place. It doesn't seem to fix anything either.
I've stepped through the program with the parameters -UnregServer and -Service to ensure that the program was being unregistered and registered successfully, and it looks like it's being registered as a service correctly.
Is this because of some error in the registry? I don't see how or why my program stops responding before it even gets to main().
What else could I try to do to debug this problem?
UPDATE:
So, I tried un-registering the service after trying to run it, and it seemed to work fine. I look in services.msc, and I still see that the application is a service. In the past, before I got error 1053, it would just disappear after the first time. I tried un-registering it again, and I got a message box:
Service could not be deleted
So I decided to run the application with the parameter -UnregServer inside of Visual Studio 2010 to figure out what the error is. The function DeleteService() is failing with the error:
ERROR_SERVICE_MARKED_FOR_DELETE
The service is not removed until all open handles to the service have been closed. I stepped through the calls to the CloseServiceHandle() function and it seems like the handles were closed successfully. The service is also not removed if the service is running. I checked Process Manager, and the service was not running. Is the service not being removed because the service stopped responding earlier?
I tried restarting my computer and it was gone. Still, I don't understand why I have to restart my computer when the service used to un-register without the need of a restart before I was getting error 1053. Unless of course I can't un-register the service because the service was not stopped because it stopped responding.
I'll keep trying some more things, but I'm running out of ideas.
UPDATE2:
I tried rebuilding the original application, which I know worked as a service. This means the problem is not related to any of my code. Something is messed up with the Services Control Manager. I don't understand why I only get this error with this application. I have another application which communicates with this application which also needs to be registered as a service. I have no problems with that application. It works perfectly.
But for some reason, this application just stopped responding all of a sudden. I don't know what I changed or broke to cause the service to hang before it even gets to my main() function. The only thing I can think of now to fix the problem is to reformat the server, which is not an option.
Thanks,
Krzys
I feel stupid.
I've been using Remote Desktop Connection to connect to this server. Well, the service is starting and erroring out. The reason I didn't see any errors or message boxes was because they were appearing on the console session. I was not connected to the console session. I connected to the server using:
mstsc.exe /admin
And now I can see where the program stops responding.
Feels great to waste 10 hours though.

Starting a windows service fails with error 1053

I have a windows service that is failing to start, giving an error "Error 1053: The service did not respond to the start or control request in a timely fashion".
Running the service in my debugger works fine, and if I double click on the the service .exe on the remote machine a console window pops up and continues to run without problem - I can even see log messages showing me that the program is processing everything the way it should be.
The service had been running fine previously, though this is my first time, personally, trying to deploy it with the most recent changes made to the program. I've evaluated those changes and cant figure out how they might cause this problem, particuarly since everything runs fine when not started as a service.
The StartRoutine() method of the service impelmentation is empty, so should be returning in a "timely fashion".
I've checked the event logs on the computer, and it doesn't give any additional information other than it didn't hear back from the service in the 30 second requisite time frame.
Since it works on my machine, and as a double-clicked executable, how would I go about figuring out why it fails as a service?
Oh, and it's .NET 2.0, so it shouldn't be affected by the 1.1 framework bug that exhibited this symptom (http://support.microsoft.com/kb/839174)
The box is a windows server 2003 R2 machine running SP2.
This is a misleading error. It's probably an unhandled exception.
Empty your OnStart() handler then try this in your constructor...
public MainService()
{
InitializeComponent();
try
{
// All your initialization code goes here.
// For instance, my exception was caused by the lack of registry permissions
;
}
catch (Exception ex)
{
EventLog.WriteEntry("Application", ex.ToString(), EventLogEntryType.Error);
}
}
Now check the EventLog on your system for your Application Error.
Could be a number of things and it might help to get a stack trace on the machine exhibiting the problem. There are a number of ways to do this but the point is that you have to see where this is failing in the code.
You can do this with remote debugging, but a simple thing might be to just log to the event logger, or file log if you have that. Literally, putting "WriteLine("At class::function()") throughout portions of the code to see if you've made it there.
This will at least get you looking in the right direction (which ultimately is the code).
Update:
See Microsoft's How to Debug Windows Services article for details in troubleshooting startup problems using WinDbg.
This related question details nice ways to debug services that are written in .NET.
I agree with Scott, the easiest way to find out what's happening is to put some traces in the start-up code (maybe it doesn't even come to your start-up code).
If this doesn't help, you can post your code here so others can take a look.
perhaps lacking some dependence, try this :
- deregister your service
- register again
If fail at register means that lack an module.
If the StartRoutine is empty, you are probably starting it somewhere else.
IIRC you need to fire off a worker thread, and then return from StartRoutine.
One of the problems which may lead to this error is if windows service which needs to be deployed consists of some error i.e it may be simple authorization error or anything as in my case I have referenced some folders and files for logging which were not existing, but when provided the right path of those file and folders it solved my problem.
I ran through every post on this particular subject and none of the responses solved the problem, so I'm adding this response in case this helps someone else. Admittedly this only applies to a new service, not this specific case.
I was writing a File listening service. As a console app, it worked perfectly. When I ran it as a service, I got the same error as above. What I didn't know (and many of the MSDN articles about services conveniently leave out) is that you need to have your class executed from within ServiceBase.Run( YourClassName());. Otherwise, your app executes and immediately terminates and because it terminated, you get the error above even if no error or exception occurred. Here is a link to an article about this. It actually discusses setting up your app for dual use - Console app and service: Create a combo command line / Windows service app
I had that issue and the source of my problem was config file. I edited it in notepad and notepad added one special character which cause service not to run properly because config file was ruined. I saw that special character in notepadd++ and after delete it, service started to run successfully as previous did.
In my case, the correct .NET framework was not installed on the server that I was installing the Windows service on.
One other reason is If you copy the DLL in 'debug' mode to installation folder this issue will come.What you need to do is Run the project in 'Release' mode copy the DLL or directly form Release folder rather than Debug folder,,and copy that DLL in to installation folder,it will work.You can see the reduction in size of DLL ,it will not contain any debug symbols and like that

Resources