Avatar of rmmarsh
rmmarsh
Flag for United States of America asked on

Error: Cannot attach to services manager service localhost:service_mgr is not defined

I have the code snippet below, where I am trying to do a backup using the Services Manager rather than starting a process.  I am getting the above error where indicated.

Can someone please tell me what I have to do (programmatically) to correct this?
FbConnectionStringBuilder cs = new FbConnectionStringBuilder();
 
            cs.UserID = "SYSDBA";
            cs.Password = "masterkey";
            cs.Database = "dbBooks";
 
            FbBackup backupSvc = new FbBackup();
 
            backupSvc.ConnectionString = cs.ToString();
            backupSvc.BackupFiles.Add(new FbBackupFile(@"j:\prager\backup\\testdb.gbk", 2048));
            backupSvc.Verbose = true;
 
            backupSvc.Options = FbBackupFlags.IgnoreLimbo;
 
            backupSvc.ServiceOutput += new ServiceOutputEventHandler(ServiceOutput);
 
            backupSvc.Execute();  //  <----------  error:  Cannot attach to services manager service :service_mgr is not defined

Open in new window

Databases.NET ProgrammingC#Programming Languages-Other

Avatar of undefined
Last Comment
rmmarsh

8/22/2022 - Mon
Bob Learned

I guess there aren't enough Firebird experts on this site, who want to tackle that question.  It sounds like you are having a problem with the Service Manager.

Did you try the GBAK command-line tool, as a test?

GBAK - Firebird Backup and Restore
http://www.destructor.de/firebird/gbak.htm
rmmarsh

ASKER
Hi Bob... yes, I did... that's how I know it works... I'm trying to get away from using "gbak.exe" in my program, using the Firebird API to see if I can get around the user id and password problems in Vista.
Bob Learned

Well, from all my understanding about the code requirements, I don't see a problem with your code.  In fact it looks like you took the code from an article that I came across, when I started my research into your problem.  

What version of Vista are you running?  Can you test this on Windows XP machine?  Service packs applied?
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
rmmarsh

ASKER
Trying to test it on XP first, with SP2 applied... I really don't understand the error message; maybe an explanation of that would help me... maybe there's something I should have started but didn't?
Bob Learned

Hmmm...that is a great question, and the only thing I can find is you trying to find an answer.  I don't have an explanation of that error either.  

1) Did you try to create FbBackupFile from a local file?  

2) Where is the application running (local machine, network, ...)?
rmmarsh

ASKER
1.  It is a local file; can't create using the API because of the error
2.  development machine, database is local also...


⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Bob Learned

"j:\prager\backup\\testdb.gbk" doesn't sound a local file to me.
rmmarsh

ASKER
It is... I have a Systemax running XP Pro / SP2 and that's just how the drive letters worked out... I didn't bother to change them because I got used to them and really didn't care...

Oops... I just saw the double \\... wonder if that's my problem... will try tonight and get back to you...
rmmarsh

ASKER
Morning Bob... removing the double \\ didn't cure the problem... do you have any idea of what "services manager" it's talking about?  If not, any suggestions on how to find out?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Nick Upson

The services manager is really the services API, accessed via whichever version of firebird executable you are running (CS or SS). Just a thought, you are not trying to do this with the embedded server are you, that only allows one connection at a time
Bob Learned

Heck, I couldn't have said it better myself...I agree that it would be good to know a little more about your environment, and how Firebird is installed.
rmmarsh

ASKER
Hi Nick... no, not using the embedded server... I am running SS with Guardian (I know it's not needed, but it installed anyway)... I'm not sure there is a "service" for the API... can you elaborate?

Environment:  Windows XP SP2, Quad Core X86, 2 G of RAM, Firebird 2.0.1 SS is installed in c:\program files\firebird

Need more info, please let me know...
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Bob Learned

OK, good thing I have SuperServer running (2.0.5.13206) on Windows XP Pro SP2 Dual Core 2 GB RAM.  What version of the .NET Data Provider do you have installed (I have 2.1.0)?  

Do you see anything about Firebird in the event log?
rmmarsh

ASKER
Hi Bob... I'll have to wait until I get home to check it out... I'll get back to you...

Thanks,
Rolf
rmmarsh

ASKER
Firebird Server (fbserver.exe) version 2.1.1.17910)

.NET Provider (FirebirdSQL.Data.Firebird.dll) version is 1.7.1.0

Nothing in the log...

I assume that I need to go to 2.1.0 of .NET provider?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Bob Learned

1) I never "assume" anything.

2) I recently upgraded my Firebird, so that is what versions I have.

3) I haven't seen that error before.

4) I am trying to help, but there are not a lot of resources available to help with Firebird (it took a while for My SQL, too).

5) Did you do anything "fancy" with the SuperServer install (or is it default)?  My guess is default, since you mentioned Guardian being installed (which is installed by default).
rmmarsh

ASKER
Hi Bob... it was a "default" install... any idea of what "service manager" it's talking about?  any way of finding out?
Bob Learned

I have to remember that I don't do much "special" work with Firebird, so this is a great question to push my skills up a notch.

Do you have the Firebird2Control.cpl in the Windows\System32 folder?  
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Nick Upson

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Bob Learned

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
rmmarsh

ASKER
Nick:  do you suppose that the FbBackup API call is only available on 2.1.0 of .NET Provider?

Bob:  has to be done from within the C# program...

R
Nick Upson

I can't say for sure as I don't use it but I would be very surprised if that were the case
rmmarsh

ASKER
I give up... I think it's a version problem with Firebird .NET... going to stay with what I have... thank you both for your time...
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23