Developer forum

Forum » Swift » DW 10 - Swift - Search result pages errors

DW 10 - Swift - Search result pages errors

Bragi Þorsteinsson
Reply

Database: Swift_20240129
Files: Swift_v1.25.1
Fresh setup with no changes

  1. Content -> Search result page
    • Error: 
    • An error occurred while attaching module (Dynamicweb.Frontend.Content)

       

      System.Data.SqlClient.SqlException (0x80131904): Login failed for user ''.
         at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken)
         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.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.SqlClient.SqlConnection.Open()
         at Dynamicweb.Content.ContentIndexSchemaExtender.GetFields()
         at Dynamicweb.Indexing.Schemas.ExtensionFieldDefinition.GetFields()
         at Dynamicweb.Indexing.IndexHelper.GetField(List`1 fieldsFromExtenders, XElement fieldElement, String& fieldTypeName)
         at Dynamicweb.Indexing.IndexHelper.FillIndexWithSchema(XElement root, IIndex index)
         at Dynamicweb.Indexing.IndexHelper.ConvertToIndex(XElement obj)
         at Dynamicweb.Indexing.IndexService.LoadIndex(String name)
         at Dynamicweb.Indexing.Queries.IndexQueryProvider.Query(IQuery query, QuerySettings settings)
         at Dynamicweb.Indexing.Querying.QueryService.Query(IQuery query, QuerySettings settings)
         at Dynamicweb.QueryPublisher.Frontend.GetModuleContent()
         at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)
      ClientConnectionId:c1dd65d7-4e52-4b09-ae4f-61d2da211c35
      Error Number:18456,State:1,Class:14
  2. Content -> Swift tools -> Services -> Product and content search results
    • Errors:
    • Error executing template "Designs/Swift/eCom/ProductCatalog/ProductSearchDropdownResponse.cshtml"
      System.ArgumentNullException: Value cannot be null. (Parameter 'source')
         at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
         at System.Linq.Enumerable.TryGetNonEnumeratedCount[TSource](IEnumerable`1 source, Int32& count)
         at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source)
         at CompiledRazorTemplates.Dynamic.RazorEngine_3b6a0bb9cb8b4a26be5c7765b78ecd9a.ExecuteAsync()
         at RazorEngine.Templating.TemplateBase.Run(ExecuteContext context, TextWriter reader)
         at RazorEngine.Templating.RazorEngineCore.RunTemplate(ICompiledTemplate template, TextWriter writer, Object model, DynamicViewBag viewBag)
         at RazorEngine.Templating.RazorEngineService.Run(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
         at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
         at RazorEngine.Templating.DynamicWrapperService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
         at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag)
         at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.<RunCompile>b__0(TextWriter writer)
         at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action`1 withWriter)
         at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag)
         at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String templateSource, String name, Type modelType, Object model, DynamicViewBag viewBag)
         at Dynamicweb.Rendering.RazorTemplateRenderingProvider.Render(Template template)
         at Dynamicweb.Rendering.TemplateRenderingService.Render(Template template)
         at Dynamicweb.Rendering.Template.RenderRazorTemplate()
    • An error occurred while attaching module (Dynamicweb.Frontend.Content)

      System.Data.SqlClient.SqlException (0x80131904): Login failed for user ''.
         at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken)
         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.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.SqlClient.SqlConnection.Open()
         at Dynamicweb.Content.ContentIndexSchemaExtender.GetFields()
         at Dynamicweb.Indexing.Schemas.ExtensionFieldDefinition.GetFields()
         at Dynamicweb.Indexing.IndexHelper.GetField(List`1 fieldsFromExtenders, XElement fieldElement, String& fieldTypeName)
         at Dynamicweb.Indexing.IndexHelper.FillIndexWithSchema(XElement root, IIndex index)
         at Dynamicweb.Indexing.IndexHelper.ConvertToIndex(XElement obj)
         at Dynamicweb.Indexing.IndexService.LoadIndex(String name)
         at Dynamicweb.Indexing.Queries.IndexQueryProvider.Query(IQuery query, QuerySettings settings)
         at Dynamicweb.Indexing.Querying.QueryService.Query(IQuery query, QuerySettings settings)
         at Dynamicweb.QueryPublisher.Frontend.GetModuleContent()
         at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)
      ClientConnectionId:09dc48e5-3555-4e64-a5c4-560583a1e8f1
      Error Number:18456,State:1,Class:14
  3. Content -> Swift tools -> Services -> Content search results
    • Error
    • An error occurred while attaching module (Dynamicweb.Frontend.Content)

      System.Data.SqlClient.SqlException (0x80131904): Login failed for user ''.
         at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling, String accessToken)
         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.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.SqlClient.SqlConnection.Open()
         at Dynamicweb.Content.ContentIndexSchemaExtender.GetFields()
         at Dynamicweb.Indexing.Schemas.ExtensionFieldDefinition.GetFields()
         at Dynamicweb.Indexing.IndexHelper.GetField(List`1 fieldsFromExtenders, XElement fieldElement, String& fieldTypeName)
         at Dynamicweb.Indexing.IndexHelper.FillIndexWithSchema(XElement root, IIndex index)
         at Dynamicweb.Indexing.IndexHelper.ConvertToIndex(XElement obj)
         at Dynamicweb.Indexing.IndexService.LoadIndex(String name)
         at Dynamicweb.Indexing.Queries.IndexQueryProvider.Query(IQuery query, QuerySettings settings)
         at Dynamicweb.Indexing.Querying.QueryService.Query(IQuery query, QuerySettings settings)
         at Dynamicweb.QueryPublisher.Frontend.GetModuleContent()
         at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)
      ClientConnectionId:a09cc95a-6b5b-43bf-91c8-ef39e89c0e15
      Error Number:18456,State:1,Class:14
SearchError.png

Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

It looks like your connection to the database is failing - with a SQL username of '' - empty string.

Like your /files/globalsettings.config file lacks the username or that you are using a custom connection string?

System.Data.SqlClient.SqlException (0x80131904): Login failed for user ''.
 
Gunnar Örn Baldursson
Reply

Hi, I had a look at Bragi's setup after your response, we had a generated GlobalSettings.Database.config with integrated security set to true, that's presumably what we were using to access the admin backend and it seemed like database connection was fine. I tried changing the config for an SQL user,  verified all the permissions were correct and removed the integrated security flag but we still had exceptions about empty usernames on the search result pages.

I found the <Database> node in the main GlobalSettings.config file which just had several empty nodes which I removed, assuming maybe DW was using the empty connection info there instead of the Database.config and everything seems ok now, at least we're no longer getting the exception on the search results page. I've not really verified if that was 100% the issue, my own setup only has connection info in the Database.config file and I haven't experienced any connection issues.

 

You must be logged in to post in the forum