Red Gate forums :: View topic - Database error, cant run SA
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 5
SmartAssembly 5 forum

Database error, cant run SA

Search in SmartAssembly 5 forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Go to page 1, 2  Next
Author Message
Uniwares_AS



Joined: 11 Oct 2007
Posts: 132

PostPosted: Thu Sep 09, 2010 8:42 pm    Post subject: Database error, cant run SA Reply with quote

No idea what might cause this error, but here it is:

Quote:
Error 4 SmartAssembly build failed:
Unable to connect to the database for the following reason:
ExecuteNonQuery requires an open and available Connection. The connection's current state is closed.

If the database is on a network, please verify the network connection.
If the problem persists, restart SmartAssembly and try again.


I just installed the latest build (over an existing installation) and tried to build.
Back to top
View user's profile Send private message MSN Messenger
Uniwares_AS



Joined: 11 Oct 2007
Posts: 132

PostPosted: Thu Sep 09, 2010 8:45 pm    Post subject: Reply with quote

Now that is weird, running SA in the build task I get this error, standalone it works.
Back to top
View user's profile Send private message MSN Messenger
Alex.Davies



Joined: 02 Dec 2008
Posts: 335
Location: Cambridge, uk

PostPosted: Fri Sep 10, 2010 1:26 pm    Post subject: Reply with quote

Interesting. When you say the latest build, do you mean the 5.5 EAP, or 5.1?
_________________
Alex
Developer,
Red Gate .NET Tools
Back to top
View user's profile Send private message
Uniwares_AS



Joined: 11 Oct 2007
Posts: 132

PostPosted: Fri Sep 10, 2010 2:08 pm    Post subject: Reply with quote

Sorry, forgot to mention it: its 5.5.114 because it solves the problem I have with 5.1 (see F0038426)

To make things more interesting, I have a VM which is a clone of my dev machine which I use for testing sometimes, just installed 5.5 there, and it works fine in both build and standalone.
Back to top
View user's profile Send private message MSN Messenger
Uniwares_AS



Joined: 11 Oct 2007
Posts: 132

PostPosted: Mon Sep 13, 2010 6:26 pm    Post subject: Reply with quote

Still trying to make it work, to no avail yet.

Some more details:

Tracing it with procmon, I see accesses to

Code:
C:\Program Files\Red Gate\SmartAssembly 5\FSharp\Windows
C:\Program Files\Red Gate\SmartAssembly 5\CSharp\Test
C:\Program Files\Red Gate\SmartAssembly 5\Modeling
C:\Program Files\Red Gate\SmartAssembly 5\CSharp\Windows
C:\Program Files\Red Gate\SmartAssembly 5\CSharp\Web
C:\Program Files\Red Gate\SmartAssembly 5\CSharp\Workflow
C:\Program Files\Red Gate\SmartAssembly 5\CSharp\Cloud
C:\Program Files\Red Gate\SmartAssembly 5\CSharp\Reporting
C:\Program Files\Red Gate\SmartAssembly 5\CSharp\Silverlight
C:\Program Files\Red Gate\SmartAssembly 5\FSharp\Silverlight
C:\Program Files\Red Gate\SmartAssembly 5\CSharp\Office\Version2007
C:\Program Files\Red Gate\SmartAssembly 5\CSharp\Office\Version2010
C:\Program Files\Red Gate\SmartAssembly 5\CSharp\WCF


C:\Program Files\Red Gate\SmartAssembly 5\OpenSesame123.settings
C:\Program Files\Red Gate\SmartAssembly 5\SmartAssembly.settings


But thats it, no tries to access the database, nada, nyet.
Back to top
View user's profile Send private message MSN Messenger
Uniwares_AS



Joined: 11 Oct 2007
Posts: 132

PostPosted: Mon Sep 13, 2010 10:26 pm    Post subject: Solved? Reply with quote

I just updated to the latest EAP build (121) and everything is back to normal. Whatever was wrong in build 114, its gone in 121.
Back to top
View user's profile Send private message MSN Messenger
Uniwares_AS



Joined: 11 Oct 2007
Posts: 132

PostPosted: Mon Sep 20, 2010 8:31 pm    Post subject: Reply with quote

Hum, had the same problem again, with the version that worked last time and again, after updating to the latest 5.5 release its now working. Would be really great to figure out what could cause this.
Back to top
View user's profile Send private message MSN Messenger
Uniwares_AS



Joined: 11 Oct 2007
Posts: 132

PostPosted: Tue Oct 19, 2010 6:31 pm    Post subject: Reply with quote

Am now back to the same problem. Can you give me ANY hint what might cause this? For the moment I am unable to do any release builds because of this slight problem.
Back to top
View user's profile Send private message MSN Messenger
Alex.Davies



Joined: 02 Dec 2008
Posts: 335
Location: Cambridge, uk

PostPosted: Wed Oct 20, 2010 12:05 pm    Post subject: Reply with quote

Hia,
It's interesting, we improved the handling of the database connection dropping out in 5.5, so that it was meant to reconnect correctly.

But I think you're saying that this happens reliably, which suggests that perhaps something is actively closing the database connection. You're using it from an MSBuild task, perhaps you're invoking SA twice, and some kind of timeout is happening in between times? Using SA twice from one MSBuild process will reuse the database connection.

Perhaps a timeout can be configured at your SQL server. If not, perhaps switching to using the command line from an MSBuild Exec task may work, as then a completely separate instance of SA is used, which will have a separate database connection, so can't time out.

Hope that helps,
_________________
Alex
Developer,
Red Gate .NET Tools
Back to top
View user's profile Send private message
Uniwares_AS



Joined: 11 Oct 2007
Posts: 132

PostPosted: Wed Oct 20, 2010 1:16 pm    Post subject: Reply with quote

If I would use SQL server that would be no problem, but I am NOT. SA is using its own local database.

Yes, SA is invoked from a MS Build task, but it doesn't even complete the first run successfully, so there in no explanation why the connection would be closed as it doesn't even open one.

Edit: even if only one assembly is processed in the MSbuild task the same error occurs.
Back to top
View user's profile Send private message MSN Messenger
Alex.Davies



Joined: 02 Dec 2008
Posts: 335
Location: Cambridge, uk

PostPosted: Wed Oct 20, 2010 3:18 pm    Post subject: Reply with quote

I'm afraid I can't think of any other reasons it might happen, and without being able to reproduce it in the main UI to get a better error message, I can't help further.

I suggest you work around it by using the command line tool and the Exec MSBuild task
Code:

  <Target Name="AfterCompile">
    <Exec Command="C:\Program Files\Red Gate\SmartAssembly 5\SmartAssembly.com MyApplication.saproj" />
  </Target>

_________________
Alex
Developer,
Red Gate .NET Tools
Back to top
View user's profile Send private message
Uniwares_AS



Joined: 11 Oct 2007
Posts: 132

PostPosted: Wed Oct 20, 2010 4:01 pm    Post subject: Reply with quote

That's not too pleasing. Aren't there any extra/hidden logging features that I might turn on?

What amazes me is that I don't see it even trying to access the database file, so SQLite seems to throw the error for some unknown reason. There are no file accesses to the database ever when run in the MSBuild task. Yet the GUI or commandline works just fine.
Might this be related to some assembly in the GAC? Maybe the build task loads some assembly it should not, or it doesn't at all?
Back to top
View user's profile Send private message MSN Messenger
Alex.Davies



Joined: 02 Dec 2008
Posts: 335
Location: Cambridge, uk

PostPosted: Wed Oct 20, 2010 4:04 pm    Post subject: Reply with quote

No, sorry, there's no logging that would be useful here.

There's no assembly in the GAC that might have any effect here.
_________________
Alex
Developer,
Red Gate .NET Tools
Back to top
View user's profile Send private message
Uniwares_AS



Joined: 11 Oct 2007
Posts: 132

PostPosted: Wed Oct 20, 2010 6:26 pm    Post subject: Reply with quote

Let me ask you something stupid: where would you expect SmartAssembly.MSBuild.Tasks.dll to be? And what version should the latest one be?

I have SA 5.5.0.121 installed here.

Having turned on fusion logging, I see the following happening:
At installation time:
Code:
*** Assembly Binder Log Entry  (20/10/2010 @ 14:19:08) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  C:\{7D3B8626-1726-4725-A40E-4426BDA46046}\redgate.installerwizard.ui.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = LEON3\as
LOG: DisplayName = RedGate.InstallerWizard.Engine.XmlSerializers, Version=1.6.0.8, Culture=neutral, PublicKeyToken=7f465a1c156d4d57, processorArchitecture=MSIL
 (Fully-specified)
LOG: Appbase = file:///C:/{7D3B8626-1726-4725-A40E-4426BDA46046}/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = redgate.installerwizard.ui.exe
Calling assembly : System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: RedGate.InstallerWizard.Engine.XmlSerializers, Version=1.6.0.8, Culture=neutral, PublicKeyToken=7f465a1c156d4d57, processorArchitecture=MSIL
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/{7D3B8626-1726-4725-A40E-4426BDA46046}/RedGate.InstallerWizard.Engine.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///C:/{7D3B8626-1726-4725-A40E-4426BDA46046}/RedGate.InstallerWizard.Engine.XmlSerializers/RedGate.InstallerWizard.Engine.XmlSerializers.DLL.
LOG: Attempting download of new URL file:///C:/{7D3B8626-1726-4725-A40E-4426BDA46046}/RedGate.InstallerWizard.Engine.XmlSerializers.EXE.
LOG: Attempting download of new URL file:///C:/{7D3B8626-1726-4725-A40E-4426BDA46046}/RedGate.InstallerWizard.Engine.XmlSerializers/RedGate.InstallerWizard.Engine.XmlSerializers.EXE.
LOG: All probing URLs attempted and failed.


Then during build:
Code:
*** Assembly Binder Log Entry  (20/10/2010 @ 14:20:40) ***

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from:  C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
--- A detailed error log follows.

LOG: IJW explicit bind. File path:C:\Program Files\Red Gate\SmartAssembly 5\SmartAssembly.exe.
LOG: IJW assembly bind returned file not found.

and
Code:
*** Assembly Binder Log Entry  (20/10/2010 @ 14:20:40) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable  C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = LEON3\as
LOG: DisplayName = SmartAssembly, Version=5.5.0.153, Culture=neutral, PublicKeyToken=7f465a1c156d4d57
 (Fully-specified)
LOG: Appbase = file:///C:/Program Files/Microsoft Visual Studio 10.0/Common7/IDE/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = devenv.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: SmartAssembly, Version=5.5.0.153, Culture=neutral, PublicKeyToken=7f465a1c156d4d57
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
ERR: Unrecoverable error occurred during pre-download check (hr = 0x80070002).


In comparism, running SA from the commandline, I get the following, but the build succeeds:
Code:


*** Assembly Binder Log Entry  (20/10/2010 @ 14:24:30) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  C:\Program Files\Red Gate\SmartAssembly 5\SmartAssembly.com
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = LEON3\as
LOG: DisplayName = {425b630c-f30d-452a-a8e4-326d72bc5f28}, PublicKeyToken=3e56350693f7355e
 (Partial)
LOG: Appbase = file:///C:/Program Files/Red Gate/SmartAssembly 5/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : SmartAssembly, Version=5.5.0.153, Culture=neutral, PublicKeyToken=7f465a1c156d4d57.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Program Files/Red Gate/SmartAssembly 5/{425b630c-f30d-452a-a8e4-326d72bc5f28}.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Red Gate/SmartAssembly 5/{425b630c-f30d-452a-a8e4-326d72bc5f28}/{425b630c-f30d-452a-a8e4-326d72bc5f28}.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Red Gate/SmartAssembly 5/{425b630c-f30d-452a-a8e4-326d72bc5f28}.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Red Gate/SmartAssembly 5/{425b630c-f30d-452a-a8e4-326d72bc5f28}/{425b630c-f30d-452a-a8e4-326d72bc5f28}.EXE.
LOG: All probing URLs attempted and failed.


Hope you are smarter than me.
Back to top
View user's profile Send private message MSN Messenger
Alex.Davies



Joined: 02 Dec 2008
Posts: 335
Location: Cambridge, uk

PostPosted: Thu Oct 21, 2010 9:54 am    Post subject: Reply with quote

SmartAssembly.MSBuild.Tasks.dll lives in the GAC and should have a file version of whichever build you have installed (5.5.0.153) but an assembly version of 5.0.0.0

If it got as far as giving the error about the database connection, all assemblies must have loaded fine.
_________________
Alex
Developer,
Red Gate .NET Tools
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Go to page 1, 2  Next
Page 1 of 2

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group