Error : While Initializing the database. See the InnerException

Hi there,

When I run the POS it loads the Pink screen and shows a error after few minutes, when I click OK button it closes.

There is a Problem.
An Exception Error occured while initializing the database. See the InnerException for Details.

I am using the POS from the past 6 months. And I have no backup of the database, can’t afford to loose the data.

Please help.

Find the log file and upload it here.

C:\Users\USERNAME\Documents\SambaPOS4\log.txt

Here is the log file.

log.zip (10.6 KB)

Unfortunately I think I did a mistake. I made a copy of SambaPOS4 folder from documents. And reinstalled the software. Now there is a new error. Please refer image. I can format my system, but is it possible I can backup the data and restore it to the new SambaPOS from the SambaPOS4 folder in the documents.

Please find a Solution ASAP.

Yes that’s not going to work.

@Jesse So do I have a chance to still backup the data ?

I have not looked at your log yet. Please don’t try any other crazy things unless your sure it will work until we can look at the log. I’m on my phone right now so can’t open a zip file.

This is the last log entry:

-----------------------------
[General Info]

Application: SambaPOS
Version:     4.1.82
Region:      en
DB:          SQ
Machine:     FRUSH-PC
User:        Frush
Date:        06-03-2016
Time:        15:53

User Explanation:

Frush said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.Data.DataException
Message:     An exception occurred while initializing the database. See the InnerException for details.
Source:      EntityFramework
Stack Trace: at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
   at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
   at System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes()
   at System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()
   at Samba.Infrastructure.Data.SqlData.EFWorkspace..ctor(CommonDbContext context)
   at Samba.Persistance.Data.WorkspaceFactory.Create()
   at Samba.Presentation.Services.Common.DataGeneration.DataCreationService..ctor()
   at Samba.Presentation.Bootstrapper.InitializeShell()

Inner Exception 1
Type:        System.Data.EntityException
Message:     The underlying provider failed on Open.
Source:      System.Data.Entity
Stack Trace: at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
   at System.Data.EntityClient.EntityConnection.Open()
   at System.Data.Objects.ObjectContext.EnsureConnection()
   at System.Data.Objects.ObjectContext.ExecuteStoreQueryInternal[TElement](String commandText, String entitySetName, MergeOption mergeOption, Object[] parameters)
   at Samba.Persistance.Data.Initializer.InitializeDatabase(DataContext context)
   at System.Data.Entity.Database.<>c__DisplayClass2`1.<SetInitializerInternal>b__0(DbContext c)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClass8.<PerformDatabaseInitialization>b__6()
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)

Inner Exception 2
Type:        System.Data.SqlClient.SqlException
Message:     Cannot open database "SambaPOS4" requested by the login. The login failed.
Login failed for user 'Frush-PC\Frush'.
Source:      .Net SqlClient Data Provider
Stack Trace: at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)

-----------------------------

[Assembly Info]

PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
System.Configuration, Version=4.0.0.0
Samba.Services, Version=1.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
Samba.Presentation.Common, Version=1.0.0.0
Samba.Domain, Version=1.0.0.0
PresentationCore, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.6.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
System.Core, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
FastButton, Version=1.0.0.0

-----------------------------

[System Info]

Operating System
-Microsoft Windows 8.1 Single Language with Bing
--CodeSet = 1252
--CSDVersion = 
--CurrentTimeZone = 330
--FreePhysicalMemory = 626364
--OSArchitecture = 64-bit
--OSLanguage = 1033
--ServicePackMajorVersion = 0
--ServicePackMinorVersion = 0
--Version = 6.3.9600

Machine
-FRUSH-PC
--Manufacturer = Hewlett-Packard
--Model = 300-010in
--TotalPhysicalMemory = 2060783616
--UserName = Frush-PC\Frush

-----------------------------

######################### E N D #########################

The important bit is this:

Inner Exception 2
Type: System.Data.SqlClient.SqlException
Message: Cannot open database “SambaPOS4” requested by the login. The login failed.
Login failed for user ‘Frush-PC\Frush’.

This basically means the credentials being used (username/password) to access the DB are not correct.


This is also in the log file:

-----------------------------
[General Info]

Application: SambaPOS
Version:     4.1.82
Region:      en
DB:          SQ
Machine:     FRUSH-PC
User:        Frush
Date:        06-03-2016
Time:        15:52

User Explanation:

Frush said ""
-----------------------------

[Exception Info 1]

Top-level Exception
Type:        System.Data.DataException
Message:     An exception occurred while initializing the database. See the InnerException for details.
Source:      EntityFramework
Stack Trace: at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)
   at System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization()
   at System.Data.Entity.Internal.LazyInternalContext.<InitializeDatabase>b__4(InternalContext c)
   at System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase()
   at System.Data.Entity.Internal.InternalContext.ForceOSpaceLoadingForKnownEntityTypes()
   at System.Data.Entity.DbContext.System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()
   at Samba.Infrastructure.Data.SqlData.EFWorkspace..ctor(CommonDbContext context)
   at Samba.Persistance.Data.WorkspaceFactory.Create()
   at Samba.Presentation.Services.Common.DataGeneration.DataCreationService..ctor()
   at Samba.Presentation.Bootstrapper.InitializeShell()

Inner Exception 1
Type:        System.Data.EntityException
Message:     The underlying provider failed on Open.
Source:      System.Data.Entity
Stack Trace: at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)
   at System.Data.EntityClient.EntityConnection.Open()
   at System.Data.Objects.ObjectContext.EnsureConnection()
   at System.Data.Objects.ObjectContext.ExecuteStoreQueryInternal[TElement](String commandText, String entitySetName, MergeOption mergeOption, Object[] parameters)
   at Samba.Persistance.Data.Initializer.InitializeDatabase(DataContext context)
   at System.Data.Entity.Database.<>c__DisplayClass2`1.<SetInitializerInternal>b__0(DbContext c)
   at System.Data.Entity.Internal.InternalContext.<>c__DisplayClass8.<PerformDatabaseInitialization>b__6()
   at System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action)

Inner Exception 2
Type:        System.Data.SqlClient.SqlException
Message:     A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)
Source:      .Net SqlClient Data Provider
Stack Trace: at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)
   at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()
   at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()
   at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()
   at System.Data.SqlClient.TdsParserStateObject.TryReadByte(Byte& value)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure)

Inner Exception 3
Type:        System.ComponentModel.Win32Exception
Message:     No process is on the other end of the pipe
Source:

-----------------------------

[Assembly Info]

PresentationFramework, Version=4.0.0.0
System.Xaml, Version=4.0.0.0
Microsoft.Practices.Prism.MefExtensions, Version=4.0.0.0
mscorlib, Version=4.0.0.0
System, Version=4.0.0.0
WindowsBase, Version=4.0.0.0
System.Configuration, Version=4.0.0.0
Samba.Services, Version=1.0.0.0
Samba.Presentation.Services, Version=1.0.0.0
Samba.Presentation.Common, Version=1.0.0.0
Samba.Domain, Version=1.0.0.0
PresentationCore, Version=4.0.0.0
DevExpress.Xpf.Core.v14.1, Version=14.1.6.0
Microsoft.Practices.ServiceLocation, Version=1.0.0.0
Samba.Infrastructure, Version=1.0.0.0
Microsoft.Practices.Prism, Version=4.0.0.0
System.ComponentModel.Composition, Version=4.0.0.0
System.Core, Version=4.0.0.0
Samba.Localization, Version=1.0.0.0
FastButton, Version=1.0.0.0

-----------------------------

The important parts:

Inner Exception 2
Type: System.Data.SqlClient.SqlException
Message: A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)

Inner Exception 3
Type: System.ComponentModel.Win32Exception
Message: No process is on the other end of the pipe

That indicates the DB Service or instance is not running.


While it is theoretically possible to copy the DB files (the .mdf and .ldf files) from one location to another, and configure the DB Engine to use those files, it isn’t really a supported way to do a proper backup. A real backup is a single file (a .bak file) that can be restored using SSMS or command-line tools.

What you should try to do is make a connection using SSMS first, and when you get that working, then SambaPOS should have no issues.

Post the contents of the SambaSettings.txt file so we can see your Connection String. The file is located in one or both of the following locations:

C:\ProgramData\SAMBAPOS\SambaPOS5\
C:\Users\USERNAME\AppData\Roaming\SambaPOS\SambaPOS5\

This is SambaSettings.txt content.

<?xml version="1.0"?><SettingsObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><MessagingServerPort>8080</MessagingServerPort><ConnectionString /><StartMessagingClient>false</StartMessagingClient><DefaultHtmlReportHeader>
&lt;style type='text/css'&gt; 
html
{
  font-family: 'Courier New', monospace;
  font-size: 11px;
} 
&lt;/style&gt;</DefaultHtmlReportHeader><CurrentLanguage>en</CurrentLanguage><OverrideLanguage>false</OverrideLanguage><OverrideWindowsRegionalSettings>false</OverrideWindowsRegionalSettings><DefaultRecordLimit>100</DefaultRecordLimit><WindowScale>1</WindowScale><FooterHeight>0</FooterHeight><UseBoldFonts>false</UseBoldFonts><ValidateExitButton>false</ValidateExitButton><AllowMultipleClients>false</AllowMultipleClients><CallerIdDeviceName /><ScaleDeviceName /><AutoMigrate>true</AutoMigrate><TokenLifeTime /></SettingsObject>

I have the SambaPOS4.mdf [125mb, Last Modified, just before it stopped working] SambaPOS4_log.ldf Files. Will it help ?

@emre Please backup the data from .mdf and idf files.

thank you.

No process is on the other end of the pipe. error message is not something I saw before. Seems like there is a problem with SQL Server but when I search this mysterious error message there are some certificate or named pipes config related problems. You can …

  1. Try to connect with management studio to test if SQL Server instance working or not.
  2. Try searching for No process is on the other end of the pipe. error message and review results to identify the problem.
  3. If possible first test it on a separate computer and if it works there uninstall everything and do a fresh install.

4 posts were merged into an existing topic: Implementation on LAN environment