Thứ Năm, 8 tháng 12, 2016

[Cpanel] Unexpected condition from IMAP server, closed or corrupt connection to IMAP. Possible mailbox corruption.

Đối với lỗi "Unexpected condition from IMAP server, closed or corrupt connection to IMAP. Possible mailbox corruption." khi sử dụng IMAP hoặc Webmail, các bạn ssh và cd vào thư muc mail của hosting

cd /home/user/mail/domain
Eg: cd /home/a406/mail/atwo.com.vn
và chay lệnh rename file dovecot.index thành dovecot.index.backup
find . -type f -name 'dovecot.index' -execdir mv {} {}_backup ';'


Một số trường hợp user không có dovecot.index mà có dovecot.index.cache nên sửa lại lệnh như bên dưới 
find . -type f -name 'dovecot.index.cache' -execdir mv {} {}_backup ';'

Thứ Tư, 7 tháng 12, 2016

[ASP.NET] 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.

Server Error in '/' Application. 

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. 


 => Lỗi này liên quan tới kết nối database quá nhiều. Max Pool Size trong connection string mặc định là 100, có thể set cao hơn để theo dõi. Tuy nhiên khuyến cáo kiểm tra code đóng mở kêt nối .


Server=myAddress:myPortNumber;Database=myDataBase;UID=myUsername;PWD=myPassword; Max Pool Size=100;Min Pool Size=10;

https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectionstring(v=vs.110).aspx

Thứ Năm, 1 tháng 12, 2016

[MSSQL] List Database (expand databse) in SSMS Slow

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/99bbcb47-d4b5-4ec0-9e91-b1a23a655844/ssms-2012-extremely-slow-expanding-databases?forum=sqltools

lý do có nhiều database đang set auto_close = on 
=> xử lý là set thuộc tính database  auto_close = off

SELECT 'Alter Database [' +name+'] set AUTO_CLOSE OFF'
FROM master.sys.databases AS dtb 
WHERE is_auto_close_on = 1
ORDER BY name

=> copy lệnh run trên query mới

Used this script to find those databases: 
SELECT name, is_auto_close_on, is_auto_shrink_on FROM master.sys.databases AS dtb 
WHERE is_auto_close_on = 1 OR is_auto_shrink_on = 1
ORDER BY name

giải thích thuộc tính  auto_close

 According to Books Online:
When set to ON, the database is shut down cleanly and its resources are freed after the last user exits. The database automatically reopens when a user tries to use the database again.

    When set to OFF, the database remains open after the last user exits

AjaxToolkit IIS7 Asp.Net 4.0 - Sys is not defined - scriptsource.axd

<handlers>
    <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <add name="ISAPI-4.0" path="*.axd" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
      <add name="ChartImageHandler" preCondition="integratedMode" verb="GET,HEAD,POST" path="ChartImg.axd" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="PricelistHandler" verb="*" path="pricelist.csv" preCondition="integratedMode" type="NopSolutions.NopCommerce.BusinessLogic.ExportImport.PricelistHandler, Nop.BusinessLogic" />
</handlers>

Cần "ScriptResource.axd" va "*.axd"

Tham khao :
http://stackoverflow.com/questions/3822733/ajaxtoolkit-iis7-asp-net-4-0-sys-is-not-defined-handler-mapping-issue

[ASP.NET] 405 - HTTP verb used to access this page is not allowed

Liên quan tới PUT method

disable webdav nếu có

 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
            <remove name="WebDAVModule" />
        </modules>
....
<handlers>
            <remove name="WebDAV" />

đồng thời add thêm PUT method vào

<handlers>
        <remove name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" />
      <remove name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" />
      <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
      <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
    </handlers>

https://support.pavietnam.vn/index.php?pa=showitem&pid=1343623

https://support.pavietnam.vn/index.php?pa=showitem&pid=1373822