Showing posts with label attach. Show all posts
Showing posts with label attach. Show all posts

Friday, March 30, 2012

RESOLVED RESOLVED An attempt to attach an auto-named database for file <file string> faile

RESOLVED RESOLVED RESOLVED

DOH! When I rebuilt the OS, I changed the data partition ID's, and didn't remember to change them in the connetion strings

Not great, but better than continuing to bang head against wall.

Would like to say to MS appreciators that the VS2005 reinstall actually went quite well, considering.

===========================================================================

I built an app, works fine. Had the development environment working fine (VS2005 (SP0) and SQL Server Express). It had been stable for months, no problem.

Then I had to reinstall XP Pro...(finally threw too many conflicting programs into it, I guess...)

I managed to get VS2005 reinstalled ok. However, when I opened and compiled my existing app in VS2005, using Cassini, I got the dreaded error:

An attempt to attach an auto-named database for file <file string> failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

I also get this error for the compiled copy of the app on the same machine, running on IIS. (Where it also previously worked fine).

The Connection strings are all of the form

connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=(specific file string).MDF;Integrated Security=True;User Instance=True"

I appreciate that there are zillions of posts on this issue. I'm hoping that someone might know why this should happen in this particular case.

The thing that's different about this case is that the app was working fine; I have the app deployed on a demo machine and also on a remote server as well as on the development machine.

The only thing that changed is that there was this fresh install of SQL Server Express.

I tried using >> sp_configure user instances enabled','1';RECONFIGURE <<< in SSMSEE, which took, but didn't help.

So something is different in SSE. Since the app is stable everywhere else, I REALLY don't want to go through and adjust the connection strings...MUCH better to figure out what SSE needs to be happy with the existing connection strings...as it was before.

Any suggestions would be appreciated.

Thanks!

EDIT-TRIED SOME THINGS:

Changed folder and file permissions to allow ASPNET full access to the .mdf's and log files (though never had to do this before on the development machine.) No change...

Can see the table contents within the .mdf through SSMSE, and also through Server Explorer in VS2005.

So because the problem happens with both IIS and Cassini, I'm assuming it's got to be an issue between ASPNET and SSE.

EDIT TRIED SOME MORE THINGS:

I dimly remember that when I had this problem before, it was that the error message was too "dumb". It wasn't my file that had the permissions problems, it was that the SSE System Databases had to have permissions with respect to ASPNET.

I tried to set that up but I'm a complete newb on this area, so I don't know if I did it right. In SSMSE I created a Login for MyComputer/ASPNET, and gave it all permissions and roles, and then made it an owner for the four system databases...but no joy.

Any pointers on this last piece would be helpful.

EDIT - MORE INFO

The error details

[SqlException (0x80131904): An attempt to attach an auto-named database for file <filestring>.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +170
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +349
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181

The most common cause of this problem is that you have a database already listed as attached in your User Instance that has the same name that is being auto generated by the AttachDbFilename path and database file. The best way to resolve this is to connect to the User Instance when it is running and then find and drop the offending database so that the name is removed from master.

I have instructons on how to connect SSMS to your User Instance in the FAQ listed at the top of this forum.

Mike

RESOLVED RESOLVED An attempt to attach an auto-named database for file <file string> faile

RESOLVED RESOLVED RESOLVED

DOH! When I rebuilt the OS, I changed the data partition ID's, and didn't remember to change them in the connetion strings

Not great, but better than continuing to bang head against wall.

Would like to say to MS appreciators that the VS2005 reinstall actually went quite well, considering.

===========================================================================

I built an app, works fine. Had the development environment working fine (VS2005 (SP0) and SQL Server Express). It had been stable for months, no problem.

Then I had to reinstall XP Pro...(finally threw too many conflicting programs into it, I guess...)

I managed to get VS2005 reinstalled ok. However, when I opened and compiled my existing app in VS2005, using Cassini, I got the dreaded error:

An attempt to attach an auto-named database for file <file string> failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

I also get this error for the compiled copy of the app on the same machine, running on IIS. (Where it also previously worked fine).

The Connection strings are all of the form

connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=(specific file string).MDF;Integrated Security=True;User Instance=True"

I appreciate that there are zillions of posts on this issue. I'm hoping that someone might know why this should happen in this particular case.

The thing that's different about this case is that the app was working fine; I have the app deployed on a demo machine and also on a remote server as well as on the development machine.

The only thing that changed is that there was this fresh install of SQL Server Express.

I tried using >> sp_configure user instances enabled','1';RECONFIGURE <<< in SSMSEE, which took, but didn't help.

So something is different in SSE. Since the app is stable everywhere else, I REALLY don't want to go through and adjust the connection strings...MUCH better to figure out what SSE needs to be happy with the existing connection strings...as it was before.

Any suggestions would be appreciated.

Thanks!

EDIT-TRIED SOME THINGS:

Changed folder and file permissions to allow ASPNET full access to the .mdf's and log files (though never had to do this before on the development machine.) No change...

Can see the table contents within the .mdf through SSMSE, and also through Server Explorer in VS2005.

So because the problem happens with both IIS and Cassini, I'm assuming it's got to be an issue between ASPNET and SSE.

EDIT TRIED SOME MORE THINGS:

I dimly remember that when I had this problem before, it was that the error message was too "dumb". It wasn't my file that had the permissions problems, it was that the SSE System Databases had to have permissions with respect to ASPNET.

I tried to set that up but I'm a complete newb on this area, so I don't know if I did it right. In SSMSE I created a Login for MyComputer/ASPNET, and gave it all permissions and roles, and then made it an owner for the four system databases...but no joy.

Any pointers on this last piece would be helpful.

EDIT - MORE INFO

The error details

[SqlException (0x80131904): An attempt to attach an auto-named database for file <filestring>.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.]
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +739123
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +188
System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +1956
System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +170
System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +349
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181

The most common cause of this problem is that you have a database already listed as attached in your User Instance that has the same name that is being auto generated by the AttachDbFilename path and database file. The best way to resolve this is to connect to the User Instance when it is running and then find and drop the offending database so that the name is removed from master.

I have instructons on how to connect SSMS to your User Instance in the FAQ listed at the top of this forum.

Mike

Saturday, February 25, 2012

Repost - RS e-mailing attachments via SMTP

I can configure a working subscription to e-mail through my SMTP server when
sending only the LINK to a report BUT NOT if I attach the report to the
e-mail in say excel or xml format.
I have tested using a command line SMTP utility and have been able to send
both a plain text message and a plain text message wth an attachment so I
know the Mail server will accept it.
I'll include a copy of the log file from when the error occurs.
Anyone out there have something for me to check? I have done my research on
the web but not been able to find any solutions.
Travis
Here's the error from the log... I can't make much of it... Other than the
part that says "more details in the log files -->please see the log
files..." :-)
ReportingServicesService!emailextension!728!07/29/2004-07:32:05:: Error
sending email.
Microsoft.ReportingServices.Diagnostics.Utilities.RSException: The Report
Server has encountered a configuration error; more details in the log
files -->
Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorEx
ception: The Report Server has encountered a configuration error; more
details in the log files
at
Microsoft.ReportingServices.Authorization.Native.GetAuthzContextForUser(IntP
tr userSid)
at Microsoft.ReportingServices.Authorization.Native.IsAdmin(String
userName)
at
Microsoft.ReportingServices.Authorization.WindowsAuthorization.IsAdmin(Strin
g userName, IntPtr userToken)
at
Microsoft.ReportingServices.Authorization.WindowsAuthorization.CheckAccess(S
tring userName, IntPtr userToken, Byte[] secDesc, ReportOperation
requiredOperation)
at Microsoft.ReportingServices.Library.Security.CheckAccess(ItemType
catItemType, Byte[] secDesc, ReportOperation rptOper)
at
Microsoft.ReportingServices.Library.RSService._GetReportParameterDefinitionF
romCatalog(CatalogItemContext reportContext, String historyID, Boolean
forRendering, Guid& reportID, Int32& executionOption, String&
savedParametersXml, ReportSnapshot& compiledDefinition, ReportSnapshot&
snapshotData, Guid& linkID, DateTime& historyDate)
at
Microsoft.ReportingServices.Library.RSService._GetReportParameters(String
report, String historyID, Boolean forRendering, NameValueCollection values,
DatasourceCredentialsCollection credentials)
at
Microsoft.ReportingServices.Library.RSService.RenderAsLiveOrSnapshot(Catalog
ItemContext reportContext, ClientRequest session, Warning[]& warnings,
ParameterInfoCollection& effectiveParameters)
at
Microsoft.ReportingServices.Library.RSService.RenderFirst(CatalogItemContext
reportContext, ClientRequest session, Warning[]& warnings,
ParameterInfoCollection& effectiveParameters, String[]&
secondaryStreamNames)
at
Microsoft.ReportingServices.Library.RenderFirstCancelableStep.Execute()
at
Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper()
-- End of inner exception stack trace --
at
Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper()
at
Microsoft.ReportingServices.Library.RenderFirstCancelableStep.RenderFirst(RS
Service rs, CatalogItemContext reportContext, ClientRequest session,
JobTypeEnum type, Warning[]& warnings, ParameterInfoCollection&
effectiveParameters, String[]& secondaryStreamNames)
at Microsoft.ReportingServices.Library.ReportImpl.Render(String
renderFormat, String deviceInfo)
at
Microsoft.ReportingServices.EmailDeliveryProvider.EmailProvider.ConstructMes
sageBody(IMessage message, Notification notification, SubscriptionData data)
at
Microsoft.ReportingServices.EmailDeliveryProvider.EmailProvider.CreateMessag
e(Notification notification)
at
Microsoft.ReportingServices.EmailDeliveryProvider.EmailProvider.Deliver(Noti
fication notification)Is this with Lotus? I know there are some problems with Lotus discussed on
this newsgroup.
Bruce L-C
"REM7600" <rem7600@.hotmail.com> wrote in message
news:OibDe9JeEHA.996@.TK2MSFTNGP12.phx.gbl...
> I can configure a working subscription to e-mail through my SMTP server
when
> sending only the LINK to a report BUT NOT if I attach the report to the
> e-mail in say excel or xml format.
> I have tested using a command line SMTP utility and have been able to send
> both a plain text message and a plain text message wth an attachment so I
> know the Mail server will accept it.
> I'll include a copy of the log file from when the error occurs.
> Anyone out there have something for me to check? I have done my research
on
> the web but not been able to find any solutions.
> Travis
>
> Here's the error from the log... I can't make much of it... Other than
the
> part that says "more details in the log files -->please see the log
> files..." :-)
> ReportingServicesService!emailextension!728!07/29/2004-07:32:05:: Error
> sending email.
> Microsoft.ReportingServices.Diagnostics.Utilities.RSException: The Report
> Server has encountered a configuration error; more details in the log
> files -->
>
Microsoft.ReportingServices.Diagnostics.Utilities.ServerConfigurationErrorEx
> ception: The Report Server has encountered a configuration error; more
> details in the log files
> at
>
Microsoft.ReportingServices.Authorization.Native.GetAuthzContextForUser(IntP
> tr userSid)
> at Microsoft.ReportingServices.Authorization.Native.IsAdmin(String
> userName)
> at
>
Microsoft.ReportingServices.Authorization.WindowsAuthorization.IsAdmin(Strin
> g userName, IntPtr userToken)
> at
>
Microsoft.ReportingServices.Authorization.WindowsAuthorization.CheckAccess(S
> tring userName, IntPtr userToken, Byte[] secDesc, ReportOperation
> requiredOperation)
> at Microsoft.ReportingServices.Library.Security.CheckAccess(ItemType
> catItemType, Byte[] secDesc, ReportOperation rptOper)
> at
>
Microsoft.ReportingServices.Library.RSService._GetReportParameterDefinitionF
> romCatalog(CatalogItemContext reportContext, String historyID, Boolean
> forRendering, Guid& reportID, Int32& executionOption, String&
> savedParametersXml, ReportSnapshot& compiledDefinition, ReportSnapshot&
> snapshotData, Guid& linkID, DateTime& historyDate)
> at
> Microsoft.ReportingServices.Library.RSService._GetReportParameters(String
> report, String historyID, Boolean forRendering, NameValueCollection
values,
> DatasourceCredentialsCollection credentials)
> at
>
Microsoft.ReportingServices.Library.RSService.RenderAsLiveOrSnapshot(Catalog
> ItemContext reportContext, ClientRequest session, Warning[]& warnings,
> ParameterInfoCollection& effectiveParameters)
> at
>
Microsoft.ReportingServices.Library.RSService.RenderFirst(CatalogItemContext
> reportContext, ClientRequest session, Warning[]& warnings,
> ParameterInfoCollection& effectiveParameters, String[]&
> secondaryStreamNames)
> at
> Microsoft.ReportingServices.Library.RenderFirstCancelableStep.Execute()
> at
>
Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper()
> -- End of inner exception stack trace --
> at
>
Microsoft.ReportingServices.Diagnostics.CancelablePhaseBase.ExecuteWrapper()
> at
>
Microsoft.ReportingServices.Library.RenderFirstCancelableStep.RenderFirst(RS
> Service rs, CatalogItemContext reportContext, ClientRequest session,
> JobTypeEnum type, Warning[]& warnings, ParameterInfoCollection&
> effectiveParameters, String[]& secondaryStreamNames)
> at Microsoft.ReportingServices.Library.ReportImpl.Render(String
> renderFormat, String deviceInfo)
> at
>
Microsoft.ReportingServices.EmailDeliveryProvider.EmailProvider.ConstructMes
> sageBody(IMessage message, Notification notification, SubscriptionData
data)
> at
>
Microsoft.ReportingServices.EmailDeliveryProvider.EmailProvider.CreateMessag
> e(Notification notification)
> at
>
Microsoft.ReportingServices.EmailDeliveryProvider.EmailProvider.Deliver(Noti
> fication notification)
>
>|||Bruce,
It's MS Exchange 2000
Thanks
TR
> Is this with Lotus? I know there are some problems with Lotus discussed on
> this newsgroup.
> Bruce L-C|||Hi Travis,
Are you using the local \Pickup folder for your SMTP service? There
are several threads in this group discussing how to set this more
efficient delivery method up. There's a setting in the
RSReportServer.config file (in the \ReportServer folder of your
default SRS installation path) that will let you specify the path to
the local SMTP pickup folder. Search that config file for "SMTP" and
check the other postings in this group that have more detail on how to
change those settings.
If you already have the Pickup folder specified, you may have to
change the SMTP Delivery properties via the IIS snap-in. From the
Delivery tab, click the Advanced button, then put the IP address [in
square brackets] of your Exchange server in the "Smart host" box. In
addition, you may have to un-check the "Attempt direct delivery"
option for this to work, as I did.
-- Ian
"REM7600" <rem7600@.hotmail.com> wrote in message news:<OibDe9JeEHA.996@.TK2MSFTNGP12.phx.gbl>...
> I can configure a working subscription to e-mail through my SMTP server when
> sending only the LINK to a report BUT NOT if I attach the report to the
> e-mail in say excel or xml format.
> I have tested using a command line SMTP utility and have been able to send
> both a plain text message and a plain text message wth an attachment so I
> know the Mail server will accept it.
> I'll include a copy of the log file from when the error occurs.
> Anyone out there have something for me to check? I have done my research on
> the web but not been able to find any solutions.
> Travis|||Thanks... I'm out of office for a week. But I'll re-read when I get back
in and give it a whirl.
TR
> Are you using the local \Pickup folder for your SMTP service? There
> are several threads in this group discussing how to set this more
> efficient delivery method up. There's a setting in the
> RSReportServer.config file (in the \ReportServer folder of your
> default SRS installation path) that will let you specify the path to
> the local SMTP pickup folder. Search that config file for "SMTP" and
> check the other postings in this group that have more detail on how to
> change those settings.
> If you already have the Pickup folder specified, you may have to
> change the SMTP Delivery properties via the IIS snap-in. From the
> Delivery tab, click the Advanced button, then put the IP address [in
> square brackets] of your Exchange server in the "Smart host" box. In
> addition, you may have to un-check the "Attempt direct delivery"
> option for this to work, as I did.
> -- Ian
>
> "REM7600" <rem7600@.hotmail.com> wrote in message
news:<OibDe9JeEHA.996@.TK2MSFTNGP12.phx.gbl>...
> > I can configure a working subscription to e-mail through my SMTP server
when
> > sending only the LINK to a report BUT NOT if I attach the report to the
> > e-mail in say excel or xml format.
> >
> > I have tested using a command line SMTP utility and have been able to
send
> > both a plain text message and a plain text message wth an attachment so
I
> > know the Mail server will accept it.
> >
> > I'll include a copy of the log file from when the error occurs.
> >
> > Anyone out there have something for me to check? I have done my
research on
> > the web but not been able to find any solutions.
> >
> > Travis