奥门威尼斯网址AFNetworking:error:Request failed: unacceptable content-type: text/html

by admin on 2019年9月22日

一台数据库服务器的事务日志备份作业偶尔会出现几次备份失败的情况,具体的错误信息为:

我们一个SQL
Server服务器在执行YourSQLDBa的作业YourSQLDba_FullBackups_And_Maintenance时遇到了错误:

欢迎加入【iOS/Swift/OC开发交流群|127183325】交流学习

Today the client tell me. all database can not be backup. and give me an
error. “Filegroup is full”.

      
今天到新上架的服务器上部署某.Net程序,运行之后发现报这个错:OCIEnvNlsCreate
failed with return code -1 but error message text was not
available。中文意思应该是:“OCIEnvNlsCreate 失败,返回代码为
-1,但错误消息文本不可用”
。肯定是Oracle某权限不足的问题,网上找资料实践摸索了几次,终于找到解决方法:在Oracle的ora92目录,选择属性,给其加上“network
service”这个用户的完全控制权限即可。桑不起啊!

 

 

今天在开始一个新项目使用AFN访问服务端给的接口的时候出现如下错误:
**error:Request failed: unacceptable content-type: text/html**
请求失败:不能接受的content-type
之前也遇到过这个错误,导致这个错误的原因就是在AFN预先可接受的content-type列表里面只有以下几个:
self.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", nil];
当时的解决方案是直接在源码里面直接添加了text/html,这个解决方案不是很好,我们最好还是不要随意修改引入的第三方框架。所以这次决定用另外一种方法来解决这个问题。如下:
NSMutableSet *acceptableSet = [NSMutableSet setWithSet:self.manager.responseSerializer.acceptableContentTypes]; [acceptableSet addObject:@"text/html"]; self.manager.responseSerializer.acceptableContentTypes = acceptableSet;
哈哈,意思很明显了,这个问题肯定被解决了。

After i check . i found the correct resaon is backup device is not
correct, the file or folder was be deleted.

 

Exec YourSQLDba.Maint.ShowHistoryErrors @JobNo = 1227

 

DATE/TIME:    2018/7/30
12:10:52

<row>

The operating system returned error 21
(failed to retrieve text for this error. Reason: 15105)
to SQL Server during a read at offset 0x00000000120000 in file
‘H:\Database\xxx.mdf’

 

<ctx>yMaint.IntegrityTesting</ctx>

System.Data.SqlClient.SqlError: Cannot open backup device
‘C:\DATABASE\_shops.bak.2010-05-23-03-00-00-000.ADD’. Operating
system error 3(failed to retrieve text for this error. Reason: 15105).
(Microsoft.SqlServer.Smo)

DESCRIPTION:
BackupDiskFile::CreateMedia: Backup device
‘M:\DB_BACKUP\LOG_BACKUP\xxxx_[2018-07-30_06h03m10_Mon]_logs.TRN’
failed to create. Operating system error 32(failed to retrieve text for
this error. Reason: 15105).

<Sql>DBCC checkDb(‘xxxx’) </Sql>

奥门威尼斯网址 1
The resion is the file is missing. the file or the folder has been
delete .

 

<err>In case of non-completion of this command check SQLServer
Error Log at 2016-11-17 00:00:03.327 for Spid 67</err>

原因是:数据库备份的文件夹不存在了。

 

</row>

COMMENT:  (None)

 

 

错误日志里面有下面一些错误信息,如下所示:

JOB
RUN: 
(None)

 

 

Date 2016/11/17 0:53:21

 

Log SQL Server (Archive #8 – 2016/11/18
0:00:00)

      关于Operating
system error 32,这个错误代码对应的错误信息为:

 

 

Source spid67

     The
process cannot access the file because it is being used by another
process.

 

 

Message

 

DBCC CHECKDB (xxxx) executed by xxxxx found 0
errors and repaired 0 errors. Elapsed time: 0 hours 53 minutes 18
seconds. Internal database snapshot has split point LSN =
00623e60:00004a5b:0001 and first LSN = 00623e60:000048f3:0011. This is
an informational message only. No user action is required.

   其实以前刚好遇到过这样的案例,使用AplexSQL
Log去分析事务日志的备份文件,YourSQLDba的事务日志备份的时候,就会遇到上面错误(YourSQLDba_LogBackups事务日志备份会追加到同一个备份文件),但是这个怎么定位这个错误呢?其实出现这个错误,一定有相关进程在访问事务日志备份文件,那么只要排查这些应用或程序即可。刚好最近配置了AWS的DMS的(DMS简单介绍如下,具体参考官方文档

 

 

Date 2016/11/17 0:53:21

 

Log SQL Server (Archive #8 – 2016/11/18
0:00:00)

在最基本级别上,AWS DMS 是 AWS
云中运行复制软件的服务器。您创建源和目标连接以告知 AWS DMS
要进行提取和加载的位置。然后,计划在此服务器上运行以迁移数据的任务。AWS DMS
会创建表和关联的主键 (如果它们在目标上不存在)。如果您愿意,则可以预先手动创建目标表。或者,也可以使用 AWS SCT
创建部分或全部目标表、索引、视图、触发器等。

 

 

Source spid13s

 

 

奥门威尼斯网址 2

Message

 

Write to sparse file
‘xxxxxxx.ndf:MSSQL_DBCC10’ failed due to lack of disk space.

 

 

因为DMS有时候会读取事务日志备份文件中的内容,通过DPA监控,刚好找的了这个DMS的账号,在事务日志备份的时间点在执行下面SQL语句(如下所示)。那么就是因为这个进程在读取事务日志备份中内容(跟普通的Replication有点不同),导致事务日志备份出现Operating
system error 32错误(The
process cannot access the file because it is being used by another
process)

 

 

SQL Server

 

 SELECT /* top 50000 */

        [Current LSN] ,

        [Operation] ,

        [Context] ,

        [Transaction ID] ,

        [Transaction Name] ,

        [Begin Time] ,

        [End Time] ,

        [Flag Bits] ,

        [PartitionId] ,

        [Page ID] ,

        [Slot ID] ,

        [RowLog Contents 0] ,

        [Log Record] ,

        [RowLog Contents 1]

 FROM   sys.fn_dump_dblog(@P1, NULL, NULL, 11,

                          'M:\DB_BACKUP\LOG_BACKUP\xxxx_[2018-08-01_06h06m19_Wed]_logs.TRN',

                          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

                          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

                          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

                          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

                          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

                          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,

                          NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)

 WHERE  [Current LSN] COLLATE SQL_Latin1_General_CP1_CI_AS >= @P2 COLLATE SQL_Latin1_General_CP1_CI_AS

        AND ( ( [Operation] IN ( 'LOP_COMMIT_XACT', 'LOP_ABORT_XACT' )

                OR ( [Operation] = 'LOP_BEGIN_XACT' /* and [Transaction SID]=SUSER_SID('') */ )

              )

              OR ( ( ( [Operation] IN ( 'LOP_INSERT_ROWS', 'LOP_DELETE_ROWS' )

                       AND [Context] IN ( 'LCX_HEAP', 'LCX_CLUSTERED',

                                          'LCX_MARK_AS_GHOST' )

                     )

                     OR ( [Operation] IN ( 'LOP_INSERT_ROWS', 'LOP_MODIFY_ROW' )

                          AND [Context] = 'LCX_TEXT_MIX'

                          AND DATALENGTH([RowLog Contents 0]) IN ( 0, 14, 28 )

                        )

                   )

                   AND [PartitionId] IN ( 72057596166537216, 72057596166471680,

                                          72057596166406144, 72057596327559168,

                                          72057596160180224, 72057596361506816,

                                          72057596119613440, 72057596119744512,

                                          72057596119678976, 72057596120006656,

                                          72057596119941120, 72057596120137728,

                                          72057596545859584, 72057596119810048,

                                          72057596231417856, 72057596418523136,

                                          72057596441067520, 72057596381364224,

                                          72057594562543616, 72057596104671232,

                                          72057594585808896, 72057594585874432,

                                          72057596242952192, 72057596168962048,

                                          72057596054994944, 72057596055453696,

                                          72057596035072000, 72057596055126016,

                                          72057596091039744, 72057596381495296,

                                          72057596381560832, 72057596524298240,

                                          72057595958067200, 72057596469116928,

                                          72057596462628864, 72057596454699008,

                                          72057596241641472, 72057595958853632,

                                          72057594563526656, 72057594563657728,

                                          72057594563723264, 72057596502802432,

                                          72057596484845568, 72057596484911104,

                                          72057596575285248, 72057596554575872,

                                          72057596485107712, 72057596485238784,

                                          72057596485304320, 72057596485369856,

                                          72057596551430144, 72057596485500928,

                                          72057594601275392, 72057594621394944,

                                          72057596548677632, 72057596561719296,

                                          72057596218638336, 72057596376842240,

                                          72057596357443584, 72057596357509120,

                                          72057596358164480, 72057596112207872,

                                          72057596023865344, 72057595959902208,

                                          72057595961081856, 72057594588889088,

                                          72057596112142336, 72057596410003456,

                                          72057595938275328, 72057596192096256,

                                          72057596192161792, 72057596367208448,

                                          72057595961868288, 72057596245508096,

                                          72057596250554368, 72057594565689344,

                                          72057596192227328, 72057596192292864,

                                          72057596248326144, 72057596248391680,

                                          72057594565754880, 2465937948672,

                                          72057596374810624, 72057594565885952,

                                          72057596133113856, 72057596563357696,

                                          48281791823872, 116258596192256,

                                          72057596132851712, 72057595963179008,

                                          72057596541861888, 72057594599047168,

                                          53296886710272, 72057595944894464,

                                          72057594566934528, 72057594567000064,

                                          72057596526395392, 72057596526592000,

                                          72057595964030976, 72057595965079552,

                                          72057594582859776, 72057594567917568,

                                          72057596525936640, 72057595908128768,

                                          72057594568048640, 119223456956416,

                                          72057594896711680, 72057594588758016,

                                          72057596133179392, 72057596132786176,

                                          72057595965931520, 72057595966455808,

                                          72057596450177024, 72057595966849024,

                                          112563398705152, 72057596184363008,

                                          72057596184428544, 72057594681425920,

                                          72057596309733376, 72057596205334528,

                                          72057596184231936, 72057595458355200,

                                          107370836852736, 72057595852423168,

                                          72057595708702720, 72057596357312512,

                                          72057596357378048, 72057596550119424,

                                          72057596301279232, 72057596357050368,

                                          72057596356984832, 72057596362293248,

                                          72057596357574656, 72057596357246976,

                                          72057596357181440, 72057596301344768,

                                          72057595809890304, 72057595873591296,

                                          72057595969011712, 72057595969536000,

                                          72057596348858368, 72057595970191360,

                                          72057596217917440, 72057596217982976,

                                          72057596526329856, 72057596332212224,

                                          114660558176256, 72057596526460928,

                                          72057596331687936, 72057596331622400,

                                          72057595970781184, 72057596574826496,

                                          72057596317859840, 72057594572242944,

                                          72057594592952320, 72057595971502080,

                                          72057595991228416, 72057596324282368,

                                          72057596220538880, 72057595972943872,

                                          72057596512370688, 72057594640334848,

                                          72057595973730304, 72057596132655104,

                                          72057594573684736, 72057594574012416,

                                          72057594776649728, 72057595974320128,

                                          72057594574798848, 45591660199936,

                                          72057594590920704, 72057595974778880,

                                          72057594593738752, 72057595975106560,

                                          72057595975696384, 72057595937882112,

                                          140014173224960, 72057594576240640,

                                          72057594576502784, 72057596501819392,

                                          72057596188360704, 72057596526264320,

                                          61775963815936, 56442625916928,

                                          72057596350365696, 14271632703488,

                                          72057596268838912, 72057596575744000,

                                          72057596442836992, 72057596459089920,

                                          72057596440281088, 72057596469444608,

                                          72057596413935616, 72057596414001152,

                                          72057596532293632, 72057596413739008,

                                          72057596414066688, 72057596548743168,

                                          72057596548612096, 72057596195110912,

                                          72057596448014336, 72057594576961536,

                                          72057594581614592, 72057594577354752,

                                          72057596310061056, 72057596488384512,

                                          72057594577813504, 72057596309995520,

                                          72057596181151744, 72057594577551360 )

                 )

              OR ( [Operation] = 'LOP_HOBT_DDL' )

            ); 

Date 2016/11/17 0:53:21

Log SQL Server (Archive #8 – 2016/11/18
0:00:00)

 

Source spid129

 

Message

D:\xxx\xxxx\xxxxx.ndf:MSSQL_DBCC10:
Operating system error 112(failed to retrieve text for this error.
Reason: 15105) encountered.

奥门威尼斯网址 3

 

另外,我们的磁盘空间告警作业也收到了大量的磁盘空间告警邮件:

 

奥门威尼斯网址 4

 

其实在白天的时候,该服务器就已经有磁盘空间告警邮件发出,由于系统管理员想在周末做存储扩容。所以在晚上数据库做DBCC
CHECKDB时,就由于磁盘空间不足,遭遇了这个错误。DBCC
CHECKDB时会生成数据库快照,而数据库的快照文件是基于稀疏文件(Sparse
File),而当快照创建后,随着对源数据库的改变逐渐增多,稀疏文件也会慢慢增长。所以,当磁盘空间不足时,就会遇到下面错误信息:

 

1:Write to sparse file ‘xxxxxxx.ndf:MSSQL_DBCC10’ failed due to lack
of disk

2:SSQL_DBCC10: Operating system error 112(failed to retrieve text for
this error. Reason: 15105) encountered

 

此时由于磁盘空间不足,就会导致DBCC CHECKDB停止。关于DBCC
CHECKDB耗用大量额外磁盘空间,可以参考下面这篇博客。

CHECKDB From Every Angle: Why would CHECKDB run out of
space?

 

参考资料:

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图