Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Thomas 160 posts 335 karma points
    Apr 01, 2015 @ 20:59
    Thomas
    0

    Extremely Urgent: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool.

    Hi,

    Suddenly i am getting the following error and i have to recycle the iis application pool in order the site to start working again. This is extremely urgent because i am talking about a production site.

    I forgot to mention that i am using Umbraco v6.2.3

    Any help please???

    Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.] System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +5356076 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) +146 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) +16 System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry) +94 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) +110 System.Data.SqlClient.SqlConnection.Open() +96 Umbraco.Core.Persistence.FaultHandling.<>c__DisplayClass1.<ExecuteAction>b__0() +10 Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction(Func1 func) +170 Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction(Action action) +80 Umbraco.Core.Persistence.PetaPocoConnectionExtensions.OpenWithRetry(IDbConnection connection, RetryPolicy retryPolicy) +98 Umbraco.Core.Persistence.PetaPocoConnectionExtensions.OpenWithRetry(IDbConnection connection) +41 Umbraco.Core.Persistence.Database.OpenSharedConnection() +51 Umbraco.Core.Persistence.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2015 @ 21:07
    Jan Skovgaard
    0

    Hi Thomas

    Is it a dedicated server or is it running on shared hosting? Have you checked that either the web or database server is not running out of space?

    /Jan

  • Thomas 160 posts 335 karma points
    Apr 01, 2015 @ 21:17
    Thomas
    0

    It is a dedicated server and i have 1.2Tb free space. This is very strange and extremely urgent. The client is very disappointed. What should i do?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2015 @ 21:21
    Jan Skovgaard
    0

    Hi Thomas

    Ok...is the database being hosted on the same server? What changes was made before this started to happen?

    /Jan

  • Thomas 160 posts 335 karma points
    Apr 01, 2015 @ 21:25
    Thomas
    0

    Yes the database is hosted on the same server. The changes that i made was two new examine indexers as follows

    <add name="ArtTravelSiteIndexer"

               type="UmbracoExamine.UmbracoContentIndexer, UmbracoExamine"

               supportUnpublished="false"

               supportProtected="true"

               analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"

               indexSet="ArtTravelSiteIndexSet"/>

     

          <add name="ArtTravelCountriesCitiesIndexer"

             type="Examine.LuceneEngine.Providers.SimpleDataIndexer, Examine"

             dataService="ArtTravel.UmbracoAddons.Infrastructure.Examine.ArtTravelCountriesCitiesService, ArtTravel.UmbracoAddons"

             analyzer="Lucene.Net.Analysis.Standard.StandardAnalyzer, Lucene.Net"

             indexTypes="CustomData"

             indexSet="CountriesCitiesFinderIndexSet"

             runAsync="true"/>

     

    and the indexSets are:

     

    <!-- Search ArtTravel Site Published Nodes Fields -->

      <IndexSet SetName="ArtTravelSiteIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/ArtTravelSite/">

        <IndexAttributeFields>

          <add Name="id" />

          <add Name="nodeName"/>

          <add Name="updateDate" />

          <add Name="writerName" />

          <add Name="loginName" />

          <add Name="email" />

          <add Name="nodeTypeAlias" />

        </IndexAttributeFields>

        <IndexUserFields>

          <add Name="bodyText"/>

          <add Name="title"/>

          <add Name="shortDescription"/>

        </IndexUserFields>

        <IncludeNodeTypes>

          <add Name="Article" />

          <add Name="travelDestinationType" />

        </IncludeNodeTypes>

      </IndexSet>

                

      <!-- Search Custom DB Fields -->

      <IndexSet SetName="CountriesCitiesFinderIndexSet" IndexPath="~/App_Data/TEMP/ExamineIndexes/CountriesCitiesFinder/">

        <IndexUserFields>

          <add Name="Id" />

          <add Name="CityCountryId" />

          <add Name="CityCountryUrl" />

          <add Name="CityCountryName" />

          <add Name="IsCountry" />

          <add Name="IsCity" />

        </IndexUserFields>

      </IndexSet>

  • Thomas 160 posts 335 karma points
    Apr 01, 2015 @ 21:29
    Thomas
    0

    I am using the first one in order to index the articles and use them in a search box with dropdown list and the second one in order to index Countries and Cities from a custom table and use them also in a search box. For the second one (ArtTravelCountriesCitiesIndexer) i am using the interface ISimpleDataService and to collect the data i am connecting to the database using the following code:

    using (var db = Umbraco.Core.ApplicationContext.Current.DatabaseContext.Database)

                {

                    var countries = db.Query<artTravelCountry>("SELECT * FROM artTravelCountries").ToList();

                    foreach (artTravelCountry item in countries)

                    {

                        //Get the installed languages

                        string whereClause = String.Format("LcTableID = ({0}) AND CultureISOCode = '{1}' AND LcResourceID = ({2}) AND rowID = {3}",

                                                            "SELECT LcTableID FROM artTravelLcTables WHERE LcTableName = 'artTravelCountries'",

                                                             new System.Globalization.CultureInfo("el-GR"), //System.Threading.Thread.CurrentThread.CurrentUICulture.Name,

                                                            "SELECT LcResourceID FROM artTravelLcResources WHERE LcResourceName = 'Name'",

                                                            item.CountryId);

     

                        string title = db.Query<String>(new Umbraco.Core.Persistence.Sql().Select(new object[] { "ResourceValue" })

                                                                                .From("artTravelLcValues")

                                                                                .Where(whereClause)).SingleOrDefault();

     

                        if (null == searchModel)

                            searchModel = new List<SearchCountriesCitiesListModel>();

     

                        SearchCountriesCitiesListModel selectedItem = new SearchCountriesCitiesListModel() 

                        { 

                            Id = item.CountryId, 

                            CityCountryName = item.CountryName, 

                            isCountry = true, 

                            isCity = false, 

                            CityCountryId = 0, 

                            CityCountryUrl = "" 

                        };

                        selectedItem.CityCountryUrl = BuildUrl(selectedItem);

     

                        if (!string.IsNullOrEmpty(title))

                        {

                            selectedItem.CityCountryName = title;

                        }

     

                        searchModel.Add(selectedItem);

                    }

     

     

                    var cities = db.Query<artTravelCity>("SELECT * FROM artTravelCities").ToList();

                    foreach (artTravelCity item in cities)

                    {

                        //Get the installed languages

                        string whereClause = String.Format("LcTableID = ({0}) AND CultureISOCode = '{1}' AND LcResourceID = ({2}) AND rowID = {3}",

                                                            "SELECT LcTableID FROM artTravelLcTables WHERE LcTableName = 'artTravelCities'",

                                                             new System.Globalization.CultureInfo("el-GR"), //System.Threading.Thread.CurrentThread.CurrentUICulture.Name,

                                                            "SELECT LcResourceID FROM artTravelLcResources WHERE LcResourceName = 'Name'",

                                                            item.CityId);

     

                        string title = db.Query<String>(new Umbraco.Core.Persistence.Sql().Select(new object[] { "ResourceValue" })

                                                                                .From("artTravelLcValues")

                                                                                .Where(whereClause)).SingleOrDefault();

     

                        if (null == searchModel)

                            searchModel = new List<SearchCountriesCitiesListModel>();

     

                        SearchCountriesCitiesListModel selectedItemCity = new SearchCountriesCitiesListModel()

                        {

                            Id = item.CityId,

                            CityCountryName = item.CityName,

                            isCountry = false,

                            isCity = true,

                            CityCountryId = item.CountryId.Value,

                            CityCountryUrl = ""

                        };

                        selectedItemCity.CityCountryUrl = BuildUrl(selectedItemCity);

     

                        if (!string.IsNullOrEmpty(title))

                        {

                            selectedItemCity.CityCountryName = title;

                        }

                        searchModel.Add(selectedItemCity);

                    }

                }

     

                return searchModel.OrderBy(m => m.CityCountryName).ToList();

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2015 @ 21:32
    Jan Skovgaard
    0

    Hi Thomas

    Ok - Is it possible for you to try and deactivate these settings and see if that helps?

    /Jan

  • Thomas 160 posts 335 karma points
    Apr 01, 2015 @ 21:35
    Thomas
    0

    I don't know if this indexers has to do with that or the following error that i am getting it a lot of times in the log file.

     

    2015-04-01 09:48:11,801 [15] ERROR Umbraco.Core.UmbracoApplicationBase - [Thread 41] An unhandled exception occurred

    System.ArgumentException: Illegal characters in path.

       at System.IO.Path.CheckInvalidPathChars(String path, Boolean checkAdditional)

       at System.Security.Permissions.FileIOPermission.CheckIllegalCharacters(String[] str)

       at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList)

       at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path)

       at System.Web.InternalSecurityPermissions.PathDiscovery(String path)

       at System.Web.HttpRequest.get_PhysicalPath()

       at UrlRewritingNet.Web.UrlRewriteModule.OnBeginRequest(Object sender, EventArgs e)

       at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

  • Thomas 160 posts 335 karma points
    Apr 01, 2015 @ 21:39
    Thomas
    0

    In the log i was getting this error continuously for at least 5 or 6 hours. This was the only error in the log file and suddenly after that error i started getting the timeout error from the sql server. 

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2015 @ 21:41
    Jan Skovgaard
    0

    Hi Thomas

    Ok - If I were you then I would try to disable the custom logic in order to figure out if that's the culprit.

    In regards to the error mentioned above it's related to some illegal characters being used in the node names, which you'll need to identify and make replace rules for in the /config/umbracoSettings.config as instructed earlier today.

    /Jan

  • Thomas 160 posts 335 karma points
    Apr 01, 2015 @ 21:46
    Thomas
    0

    Regarding the illegal characters i tried to make replacements, but still i am getting errors. I don't know if as illegal characters are symbols like the followings:

    ó and á in the word Józsefváros

    or i and à in the words Ferran Adrià

    or ç in the words François Payard

  • Thomas 160 posts 335 karma points
    Apr 01, 2015 @ 21:48
    Thomas
    0

    And as for the custom logic, you mean the second indexer with the IDataService interface because the first one is using the default umbraco logic for indexing nodes with restrictions in order to index less data. So i believe that this will not be a problem?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2015 @ 22:16
    Jan Skovgaard
    0

    Hi Thomas

    Those can be an issue as well I think - I would replace them too...so ó becomes o etc.

    /Jan

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Apr 01, 2015 @ 22:17
    Jan Skovgaard
    0

    Hi Thomas - Sorry missed the last post - I would try to deactivate everything of what you made before the errors started to happen and see if that fixes it. If so then I would try activating the different parts of the code step-by-step to figure out where there could be an issue.

    /Jan

  • Thomas 160 posts 335 karma points
    Jun 02, 2015 @ 07:12
    Thomas
    0

    Hi, I am still getting the following error with version 6.2.3. Can anyone assist me what to do because i am getting a lot of complaints from the client.

    Regards

    Thomas

  • Michelle 4 posts 24 karma points
    Jun 05, 2015 @ 04:10
    Michelle
    0

    I'll also jump in and say our environment is also having this problem. Umbraco v7.2.1 with Contour 3.0.23.

    Noticed it more when trying to save Contour forms though we also just started building some search indexes this week and suddenly this issue arises. Not sure which is the culprit.

    Hopefully someone can help out!

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    May 16, 2017 @ 09:22
    Markus Johansson
    0

    Hi Michelle! How did you solve this?

  • Thomas 160 posts 335 karma points
    Jun 05, 2015 @ 09:03
    Thomas
    0

    And today i got the following error in umbraco log and the site as you can understand was down. Can anyone help with this because it is very urgent, there is a problem with the connections with the database that arise that problem.

    2015-06-05 07:54:08,735 [7] ERROR Umbraco.Core.UmbracoApplicationBase - [Thread 310] An unhandled exception occurred
    

    System.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.) ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out 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, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.Open() at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.<>cDisplayClass1.0() at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func1 func) at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction(Action action) at Umbraco.Core.Persistence.PetaPocoConnectionExtensions.OpenWithRetry(IDbConnection connection, RetryPolicy retryPolicy) at Umbraco.Core.Persistence.PetaPocoConnectionExtensions.OpenWithRetry(IDbConnection connection) at Umbraco.Core.Persistence.Database.OpenSharedConnection() at Umbraco.Core.Persistence.Database.<Query>d__71.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at umbraco.cms.businesslogic.language.Language.<GetAllAsList>b__8() at Umbraco.Core.Cache.CacheProviderExtensions.<>c__DisplayClass11.

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    May 16, 2017 @ 05:40
    Markus Johansson
    0

    How did you end up solving this issue?

  • Jay 425 posts 652 karma points
    Jun 14, 2017 @ 09:37
    Jay
    0

    Having similar issues, any solution? Anyone?

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Jun 14, 2017 @ 10:25
    Markus Johansson
    0

    Also, I you are using SEO Checker, have a look here: https://our.umbraco.org/projects/website-utilities/seo-checker/bugs/85512-there-is-already-an-open-datareader-associated-with-this-command-which-must-be-closed-first

    The underlaying problem is the same since older versions of SEO Checker is using the legazy database helpers.

  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Jun 14, 2017 @ 10:22
    Markus Johansson
    0

    What Umbraco version are you on? Any plugins? If you are on Umbraco 7.6+ and plugins or your custom code uses the old Database helpers this might be the problem.

    Any error messages that you can share?

    EDIT:

    You can also see all open connections to SQL Server using this query:

    SELECT 
    DB_NAME(dbid) as DBName, 
    COUNT(dbid) as NumberOfConnections,
    loginame as LoginName
    FROM
       sys.sysprocesses
    WHERE 
       dbid > 0
    GROUP BY 
       dbid, loginame   
     ;
    

    If you have more than 100 on your dev-machine it's totally related to connections not being closed - either by plugins using the old database helpers or by your custom code.

    Cheers!

  • Jay 425 posts 652 karma points
    Jun 14, 2017 @ 10:51
    Jay
    0

    Thanks Markus, on V6.2.4.

    Can't find anything in the code that's calling any old Database helpers.

    Lots of packages used though, not sure any is causing it:

    • BulkManager
    • Content Maintenance Dashboard
    • Dynamic Data Grid
    • Embedded Content
    • FALM Housekeeping
    • FamFamFam Icon Package
    • Full Text Search
    • Google Maps for Umbraco
    • LockoutMembership provider
    • uComponents
    • Umbraco Contour
    • Umbraco Core Property editor converters
    • Umbraco Courier
    • uSync for Umbraco 6

    Error codes I've got as below, which only happens randomly. Can't figure out what's triggering it.

    2017-06-13 18:05:15,226 [14] ERROR Umbraco.Web.WebServices.ScheduledPublishController - [Thread 21] Error executing scheduled task
    System.InvalidOperationException: Timeout expired.  The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.
       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.TryOpenInner(TaskCompletionSource`1 retry)
       at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
       at System.Data.SqlClient.SqlConnection.Open()
       at System.Data.SqlClient.SqlConnection.Open()
       at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.<>c__DisplayClass1.<ExecuteAction>b__0()
       at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)
       at Umbraco.Core.Persistence.Database.OpenSharedConnection()
       at Umbraco.Core.Persistence.Database.<Query>d__1c`1.MoveNext()
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       at Umbraco.Core.Persistence.Repositories.ContentRepository.<PerformGetByQuery>d__22.MoveNext()
       at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
       at Umbraco.Core.Publishing.ScheduledPublisher.CheckPendingAndProcess()
       at Umbraco.Web.WebServices.ScheduledPublishController.Index()
    
  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Oct 01, 2019 @ 12:39
    Alex Skrypnyk
    0

    Any solutions for this topic?

    I got a similar issue, Umbraco 7.1.4, sometimes goes down with error in the log

    The timeout period elapsed prior to obtaining a connection from the pool.  This may have occurred because all pooled connections were in use and max pool size was reached.
    
  • Markus Johansson 1936 posts 5864 karma points MVP 2x c-trib
    Oct 02, 2019 @ 08:42
    Markus Johansson
    0

    Did you check if you're using any of the packages / plugins that might use the old database helpers?

    Like SEO Checker and others, might be good to update them, have a look at the numer of connections to the db using my example above - do you see a lot of them? Are they growing when using a certain part of the website / backoffice?

Please Sign in or register to post replies

Write your reply to:

Draft