"database version could not be detected"

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
tourcd
New user
New user
Posts: 18
Joined: 2005-06-01 16:48

"database version could not be detected"

Post by tourcd » 2005-07-14 19:39

I've just installed hMailServer 4.0 - Build 125 on a Win2K Sever platform running MSSQL 2000 SP3a.

When I try and run the Administrator tool I get a popup box with "database version could not be detected", there's only an option to 'ok' and that's it.

Does anyone have any suggestions?

Not sure if it helps but my hMailServer.ini looks like this...

[Directories]
ProgramFolder=C:\Program Files\hMailServer
DataFolder=C:\Program Files\hMailServer\Data
LogFolder=C:\Program Files\hMailServer\Logs
TempFolder=C:\Program Files\hMailServer\Temp
EventFolder=C:\Program Files\hMailServer\Events
[GUILanguages]
ValidLanguages=bulgarian,chinese,czech,danish,dutch,english,finnish,french,german,greek,hungarian,italian,japanese,norwegian,portuguesebrazilian,portugueseportugal,spanish,swedish,turkish
[database]
type=MSSQL
username=xxx
password=xxx
port=1433
server=127.0.0.1
database=hmailserver

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2005-07-14 19:53

First, you should check your error log. If you open up the Log folder (path found in your hmailserver.ini), you'll have an error log. This log contains more detailed information on what failed. If you post the contents here, we'll be able to tell what's wrong.

tourcd
New user
New user
Posts: 18
Joined: 2005-06-01 16:48

Error Logs

Post by tourcd » 2005-07-14 23:56

Here are some error logs although I'm not sure that anything is written to them when I start the administrator.

----------------
"ERROR" 664 "2005-07-14 18:25:33.812" "Source: ADOConnection::Connect(), Code: HM10043, Description: Error when connecting to database. Microsoft OLE DB Provider for SQL Server Timeout expired Run hMail Administrator and check your database settings."
"ERROR" 664 "2005-07-14 18:25:40.390" "Source: ADOConnection::Execute, Code: HM10046, Description: Unknown error when executing SQL statement.
select * from hm_dbversion
Microsoft OLE DB Provider for SQL Server
SELECT permission denied on object 'hm_dbversion', database 'hmailserver', owner 'dbo'."
"ERROR" 664 "2005-07-14 18:25:40.953" "Exiting: Application::InitInstance - Database initialization failed."
"ERROR" 764 "2005-07-14 18:42:48.609" "Source: ADOConnection::Execute, Code: HM10046, Description: Unknown error when executing SQL statement.
select * from hm_dbversion
Microsoft OLE DB Provider for SQL Server
SELECT permission denied on object 'hm_dbversion', database 'hmailserver', owner 'dbo'."
"ERROR" 764 "2005-07-14 18:42:48.609" "Exiting: Application::InitInstance - Database initialization failed."
"ERROR" 656 "2005-07-14 18:44:42.109" "Source: ADOConnection::Execute, Code: HM10046, Description: Unknown error when executing SQL statement.
select * from hm_dbversion
Microsoft OLE DB Provider for SQL Server
SELECT permission denied on object 'hm_dbversion', database 'hmailserver', owner 'dbo'."
"ERROR" 656 "2005-07-14 18:44:42.109" "Exiting: Application::InitInstance - Database initialization failed."

cgountanis
Normal user
Normal user
Posts: 105
Joined: 2005-07-01 00:54
Location: USA

Post by cgountanis » 2005-07-15 01:28

Same thing... Server seems to run and send /get emails fine. THe administrator bugs out. Doing a config existing database wizard fixes the issue not getting into admin. ADO Error :(



"ERROR" 2532 "2005-07-14 18:17:35.234" "Source: ADOConnection::Execute, Code: HM10046, Description: Unknown error when executing SQL statement.
select * from hm_messages where messagetype = 1 and messagenexttrytime <= GETDATE() and messagelocked = 0 order by messageid asc
Microsoft OLE DB Provider for SQL Server
[DBNETLIB][ConnectionWrite (send()).]General network error. Check your network documentation."
"ERROR" 2532 "2005-07-14 18:17:35.250" "Source: ADOConnection::RecordCount, Code: HM10047, Description: Error while determening the number of rows in a recordset
ADODB.Recordset
Operation is not allowed when the object is closed."
"ERROR" 768 "2005-07-14 18:19:31.468" "Source: ADOConnection::Connect(), Code: HM10043, Description: Error when connecting to database. Microsoft OLE DB Provider for SQL Server Timeout expired Run hMail Administrator and check your database settings."

cgountanis
Normal user
Normal user
Posts: 105
Joined: 2005-07-01 00:54
Location: USA

Post by cgountanis » 2005-07-15 01:29

ADO: Timeout Expired is the message box on trying to open admin. Like I said seems server is running fine though.

cmurphy54
Senior user
Senior user
Posts: 550
Joined: 2004-09-25 22:11
Location: Atlanta, GA
Contact:

Post by cmurphy54 » 2005-07-15 04:56

tourcd,

The important error message in those logs is:
SELECT permission denied on object 'hm_dbversion', database 'hmailserver', owner 'dbo'."
This means that the user you are using to connect to MSSQL server doesn't have read permissions to the db.

How to fix:

Open Enterprise Manager
Click on your DB Server
Expand the Databases folder
Expand the hMailServer db
Click Users
Double click on the user hmailserver is using to connect
Make sure db_datareader and db_datawriter checkboxes are checked
Click ok

cgountanis,

Your issue does not appear to be the same. Not sure what it is though. It definitely seems weird that the server seems to run, but hMailAdmin doesn't.

tourcd
New user
New user
Posts: 18
Joined: 2005-06-01 16:48

Post by tourcd » 2005-07-15 09:42

Still no luck, I've given that user full control to my SQL database, here's the error I'm getting. However if I run through the database setup wizard again the administrator works until I reboot/logoff the box.

"ERROR" 664 "2005-07-15 08:34:39.140" "Source: ADOConnection::Connect(), Code: HM10043, Description: Error when connecting to database. Microsoft OLE DB Provider for SQL Server Timeout expired Run hMail Administrator and check your database settings."
"ERROR" 720 "2005-07-15 08:39:23.078" "Source: ADOConnection::Execute, Code: HM10046, Description: Unknown error when executing SQL statement.
select * from hm_dbversion
Microsoft OLE DB Provider for SQL Server
SELECT permission denied on object 'hm_dbversion', database 'hmailserver', owner 'dbo'."
"ERROR" 720 "2005-07-15 08:39:23.125" "Exiting: Application::InitInstance - Database initialization failed."

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2005-07-15 10:18

When you run hMailServer Database Setup and select to use MSSQL, you don't enter username or password. The reason for this is that hMailServer uses Windows Authentication when connecting to MSSQL and not user/password. (This is recommended by Microsoft). So the user/password you've manually entered in hMailServer.ini has no effect.

By default, the hMailServer service runs under the Local Service user account. This account may not have the permissions to connect to your MSSQL server, depending on your configuration.

So whay you need to do is to configure the hMailServer service to run under an account that has permissions to connect to the database. This is done in the service properties in Control panel->Administrative tools->Services.

tourcd
New user
New user
Posts: 18
Joined: 2005-06-01 16:48

Post by tourcd » 2005-07-18 18:52

I've changed the user associated with the hmailserver service to be the local admin of my server. This hasn't resolved the problem, is there a recommend way of setting up MSSQL? If so I'll reinstall it.

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2005-07-18 18:56

What error message is given when you try to start the hMailServer service, after you've changed the user account for it?

I'm afraid there's no guidelines. Default setup of MSSQL should work just fine. It should be as simple as this.. :-\

tourcd
New user
New user
Posts: 18
Joined: 2005-06-01 16:48

Post by tourcd » 2005-07-18 19:06

The service starts with no problems but the administrator still won't start, it comes up with the same message box as previously mentioned.

Are there any logs that would be useful to look at?

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2005-07-18 20:04

Yes, the log you looked at previously (the hMailServer error log). It's located here:

C:\Program Files\hMailServer\Logs

cgountanis
Normal user
Normal user
Posts: 105
Joined: 2005-07-01 00:54
Location: USA

Post by cgountanis » 2005-07-18 20:29

FYI SQL Server SP4 is out and works fine. Did you try a reinstall of SQL Server and hMailServer (if isn't a big burden)?

tourcd
New user
New user
Posts: 18
Joined: 2005-06-01 16:48

Post by tourcd » 2005-07-18 20:47

Here's the error log. Obviously a permissions problem but I can't see where I'm going wrong, any pointers? I'm pretty sure the local admin has full permissions to the database.

"ERROR" 636 "2005-07-18 19:43:53.171" "Source: ADOConnection::Execute, Code: HM10046, Description: Unknown error when executing SQL statement.
select * from hm_dbversion
Microsoft OLE DB Provider for SQL Server
SELECT permission denied on object 'hm_dbversion', database 'hmailserver', owner 'dbo'."
"ERROR" 636 "2005-07-18 19:43:53.218" "Exiting: Application::InitInstance - Database initialization failed."

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2005-07-18 21:05

So you've configured the hMailServer service to log on as the local administrator, right?

And MSSQL is running on the same machine as hMailServer is?

Have you modified the permissions on the database after it was created?

Open Enter rise Manager->SQL Server Group->[sql server->Security->Logiins. Select "BUILTIN\Administrators". Select the "Database access" tab. Is the hMailServer database selected here?

tourcd
New user
New user
Posts: 18
Joined: 2005-06-01 16:48

Post by tourcd » 2005-07-22 09:48

Almost there, I've reinstalled MSSQL and configured an account as you suggested above. The problem now seems to be that my hmailserver service starts before MSSQL. I need to make the hmailserver dependant on the MSSQL server service and I think that will fix it. Do you know how I can do this?

tourcd
New user
New user
Posts: 18
Joined: 2005-06-01 16:48

Post by tourcd » 2005-07-22 09:51

Forget than last question, just found the answer...

http://www.hmailserver.com/documentatio ... to_install

(section 3)

Everything working okay now, thanks.

Post Reply