A problem with a Windows service using SubSonic 3 - subsonic

I'm trying to implement a C# Windows service, which utilizes SubSonic 3 to query and update a MSSQL database. The problem is that when I start the service, Windows Service manager says "The MyService on Local Computer started and stopped. Some services stop automatically if they are not in use by other services or programs". Application event log says that "Service cannot be started. System.Data.SqlClient.SqlException (0x80131904): Incorrect syntax near the keyword 'Update'." followed by a stack trace.
I'm installing and starting the service as an admin. The error occurs only when the service is trying to run a query to the database. What I'm doing wrong? Any help is appreciated!
The service is developed using Visual Studio 2010 and running it as normal application works fine.
Best regards,
Aki

The query is causing an unhandled exception, which causes your service to stop. You will need to determine what the query is that is causing the issue and try to fix that. Judging from the error message, it looks like SubSonic might be generating some invalid SQL for your query.

Related

IIS return Microsoft Data Access Components error

I have a web .net application, it will read an excel file using the Microsoft Access Database Engine. It works fine , but recently it is giving some error. From the log, these 2 points i think are the highlight, which I still could not find a solution. I have tried reinstalling Microsoft Access Database Engine, but not helping. Google for it, but didn't manage to get a hint as well.
One funny thing is whenever it happened, I recycle the app pool on IIS and issue was resolved. But then the issue will come back very quickly. If anyone had come across this, would appreciate any help. Thanks.
The .Net Framework Data Providers require Microsoft Data Access Components(MDAC). Please install Microsoft Data Access Components(MDAC) version 2.6 or later
Retrieving the COM class factory for component with CLSID {2206CDB2-19C1-11D1-89E0-00C04FD7A829} failed due to the following error: 800703fa Illegal operation attempted on a registry key that has been marked for deletion. (Exception from HRESULT: 0x800703FA)
To resolve this problem, please follow official doc to try.
Method 1
Do not log on to the server for interactive sessions by using a service account.
Method 2
Disable the related Windows User Profile Service feature.
For more details, please read this article.
"800703fa Illegal operation attempted on a registry key" error

Setting up cakephp3 on azure webapp on linux

I am new to Azure. I would like to setup web app of cakephp 3+ on web app service of azure. I made a web app and tried to install cakephp by composer.
I get the following error:
Fixture creation for "requests" failed "SQLSTATE[HY000]: General Error: 5 database is locked"
Fixture creation for "panels" failed "SQLSTATE[HY000]: General Error: 5 database is locked"
I thought this error was the database connection. But I made a custom script and I saw the web server was able to connect to the database server. I also checked for php version compatibility, but it was all fine, as my dev server is running on same php(7.0) with same cake version. I looked into the looked into logs but nothing helped me. When I exported the code/cakephp to other server it works without any issue. Microsoft did not help me.
Please help in solving the issue.
The "requests" and "panels" tables are used by DebugKit, and created automatically if they don't exist. Presumably, the database user you are connecting to the database with doesn't have "create" permissions here. Either correct that, or disable the DebugKit plugin in your config/bootstrap.php.

dotnet core IIS website restart on error (for example sql server reboot)

I'm currently facing the following problem when hosting a dotnet core application with IIS.
When the webserver boots before the database server, the dotnet-application throws an error that it is unable to connect to the database. So for so good offcourse.
But the problem is that when it faces this error on startup, it will never again try to connect to the database. The dotnet core application seems to be giving up when facing a startup error.
Is there some general re-try mechanism available to handle these kind of errors? So for example when the application detects a problem, to restart every 5 minutes?
I seem to have found the answer myself. It was during my startup-logic that I already was connecting to the sql database. I could simply force IIS to try to restart the process, until initialization worked out by explicitly shutting down the application using Environment.Exit(-1); whenever an error occured

Your role instances have recycled a number of times during an update or upgrade operation

I am trying to deploy a Cloud Service with 1 Web Role to Azure.
When I do so, I get this message:
Your role instances have recycled a number of times during an update or upgrade operation. This indicates that the new version of your service or the configuration settings you provided when configuring the service prevent the role instances from running. Verify your code does not throw unhandled exceptions and that your configuration settings are correct and then start another update or upgrade operation.
The project runs just fine locally, and I'm having a hard time figuring out how to start debugging this issue. Are there any common problems that cause this message or steps to figure out what is causing it?
See https://learn.microsoft.com/en-us/archive/blogs/kwill/windows-azure-paas-compute-diagnostics-data. This will walk through all of the diagnostic data available as well as how to troubleshoot the most common issues.
We also had this annoying problem and in our case:
We use local storage, but it wasn't defined in service definition (or Worker Role's properties)
Our worker role project has reference to a service project which has reference to data layer project. But, the worker role project doesn't have reference to the data layer project. As soon as we added reference to data layer project in worker role project, it deploys successfully.
Problem #1 can be easily noticed if you first run the project in your local machine. Exception will be thrown.
Problem #2, however, is more difficult, mainly because it runs just fine in local machine. After 5 days of trouble shooting, we finally found the problem. So, check all references and try to add sub-reference projects, those that are referenced by other references.
We had similar problem, and it was due to some DDLs failed to load. (due to different version from the one MS have deployed to the VM)
Try to set CopyLocal to "true" for all the References in the project, and re-deploy.
I would either remote desktop to the cloud instance and review the Windows Event Logs for exceptions or redeploy with IntelliTrace Enabled. If you choose the later, you can download the IntelliTrace logs from Visual Studio and debug
http://msdn.microsoft.com/en-us/library/windowsazure/ff683671.aspx
One way to find out the actual error is to click on the " 1 instance" at the top of Dashboard after trying to deploy your web role. It will tell you the status of the role instance. The status should include more information about the type of error which blocks your deployment.
It depends on what your case is. For me, the status claimed that I had an unhandled Security exception. After some investigation, it turned out that under my role's OnStart(), I tried to create a event source. However, Azure service doesn't have the permission to create an event source.
For more possible issues, check http://blogs.msdn.com/b/kwill/archive/2013/09/06/troubleshooting-scenario-3-role-stuck-in-busy.aspx
For me, the issue was with my SQL Azure DB firewall rules. My Azure SQL Database servers are not set to "Allow Access to Azure services", so I have to explicitly list IPs that are allowed.
I discovered this after wrapping my code in a try/catch that swallowed all exceptions, refactoring my OnStart() and RunAsync() methods, and setting all my references to Copy Local = True. None of that worked, then I saw that I had this line in my RunAsync() method:
log4net.Config.XmlConfigurator.Configure();
I am using the AdoNetAdapter for log4net and connecting to an Azure SQL DB for logging, so that led me to check the firewall rules.
For me, I had some differing version of nuget packages in my various projects. Once I consolidated everything to the same version(s), it worked fine.
With the release of Windows Azure SDK version 2.2 for Visual Studio 2012 and 2013, Now you can Remote Debug Cloud Resources within Visual Studio.
Once your cloud service is published and running live in the cloud, you can simply set a breakpoint in your local source code. This may help you in digging out what's going wrong!

Unable to start Message Engine in Websphere

I am facing a problem while starting the websphere message engine for one of the application deployed on websphere. This application is getting deployed automatically as a part of the installation of Websphere Lombardi 7.2 express edition. It's using websphere 7 internally to deploy it. When I try to start the message engine from the administrative console of websphere I am getting following error:
The messaging engine ProcessCenter01.twperfsvr-twperfsvr_bus cannot be started as there is no runtime initialized for it yet, retry the operation once it has initialized. For the runtime to successfully initialize the hosting server must be started, have its 'SIB service' already enabled, and dynamic configuration reload enabled. If this is a newly configured messaging engine and it is the first messaging engine to be hosted on this server, then it is most likely the 'SIB service' was not previously enabled and thus the server will need to be restarted. The messaging engine runtime might not be initializing because of an error while trying to start, examine the SystemOut.log of the hosting server to check for error messages indicating the problem.
After restarting the server, the same error shows. Can anyone help me to to find what gets loaded as a part of "initialization of runtime"? Are there any config files etc. that I need to check to solve this issue? I am suspecting some missing configuration causing error to load the runtime for this particular application.
I too faced this issue today had to delete all the files under the message store
check the directory-file path mentioned in
Application servers > server1 > Messaging engines > XXX.server1-primaryBus > File store
Just Enable the SIB Services For the particular Server.
Example:Server-->Application Server-->click on Server Name-->right hand side we can see SIB services-->Check box the Enable services.
This will solve your problem
Recently I have faced the same issue when I rebuilt the jvms in UAT envt. After searching on web I found that because of the old messages saved in the message store(flat files in my envt) the messaging engines was not getting initiated. After deleting the old messaging store and restarting the servers it got initialized.
I have struggled with this problem too.
In our situation the problem was that the file message store location was used that was already created for a different (or old) message-engine.
If you add a busmember to the service-bus and use a file store implementation, then you need to supply the path for the store and log folder. Make sure these locations don't exist yet, other wise you will run in the problem above. The message-engine for this member will use these folders.
If you have a script for creating the message-bus infrastructure, make sure that when you delete the bus or remove message-engines, that you remove the file store/log folders for these, before you re-run your script.
Another possibility is that you are using a external database as a data store, and the user that is used for the connection is not allowed to create a database. You might find a ffdc entry like this:
DB2 SQL Error: SQLCODE=-552, SQLSTATE=42502, SQLERRMC=DB2ADMIN;CREATE
SCHEMA, DRIVER=3.61.65
Then you have to go to your database administration tool and give DB2ADMIN the proper privileges. Then restart the server or cluster.
Finally this issue is been resolved. I did not create the schema in SQL Server with same name as that of the username I gave to connect SQL Server during the installation of WLE 7.2
Please find details about this at below link:
http://www.ibm.com/developerworks/forums/message.jspa?messageID=14795282

Resources