- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在 Azure 网站内运行 RavenDb.Embedded v2.0.2370。
除了备份之外,所有这些都按预期工作。使用 EmbeddableDocumentStore.DocumentDatabase.StartBackup(...)
启动的备份例程过去工作得很好,直到我注意到最后一次成功的备份是在 1 月 30 日左右(不要问:-) )下午 6 点(UTC0)左右,并且在 2 月 11 日上午 8 点(UTC0)左右启动的下一次备份失败,之后到现在为止启动的所有其他备份也失败了。
因此,Azure 方面的这两个日期之间肯定发生了某些更改,因为自 2013 年 5 月以来,Web 应用程序没有发生任何更改或部署
所以我做了一些调查,以下是我的发现:
RavenDb 备份状态在每次启动备份后显示以下消息:
Failed to complete backup because: Cannot create a file when that file already exists
在 enabling logging for RavenDb 之后,日志文件在运行备份时显示以下错误
2014-04-12 10:38:20.5797,Raven.Storage.Esent.Backup.BackupOperation,Error,Failed to complete backup,"System.ComponentModel.Win32Exception (0x80004005): Cannot create a file when that file already exists at Raven.Database.Backup.DirectoryBackup.Prepare() at Raven.Storage.Esent.Backup.BackupOperation.Execute(Object ignored)
根据 Azure Web Sites forum,在上次成功备份和第一次失败备份之间的时间段内没有对 Azure 网站进行计划维护。 2013年12月9日至15日和2014年3月10日至14日期间
我确实在 Azure Service Dashboard 上注意到西欧地区的网站于 1 月 31 日出现问题,但该网站托管在北欧地区
当 RavenDb 代码出现故障时 looking (even the last version) Raven.Database.Backup.DirectoryBackup.Prepare
时,似乎是在调用 CreateHardLink 时引发了异常
这是一个定义为
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern bool CreateHardLink(string lpFileName, string lpExistingFileName, IntPtr lpSecurityAttributes);
奇怪的是,代码实际上检查了上面显示的特定异常(0x80004005),但异常仍然抛出......
if (Marshal.GetLastWin32Error() != 0x80004005)
throw new Win32Exception();
为了将 RavenDb 排除在等式之外,我创建了以下小程序,该程序模拟 RavenDb 在备份例程期间以及部署可执行文件并执行它之后实际执行的操作(通过 new azure portal 上找到的控制台功能)在 Azure 网站上它也失败了:
using System;
using System.ComponentModel;
using System.IO;
using System.Runtime.InteropServices;
namespace HardLinkCreationTester
{
public class Program
{
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern bool CreateHardLink(string lpFileName, string lpExistingFileName, IntPtr lpSecurityAttributes);
static void Main()
{
const string sourcePath = "TestSource";
const string targetPath = "TestTarget";
const string tempPath = "TestTemp";
try
{
Directory.CreateDirectory(sourcePath);
Directory.CreateDirectory(targetPath);
Directory.CreateDirectory(tempPath);
File.WriteAllText(Path.Combine(sourcePath, "testfile.txt"), "Test content");
string[] sourceFilesSnapshot = Directory.GetFiles(sourcePath);
for (int index = 0; index < sourceFilesSnapshot.Length; index++)
{
var sourceFile = sourceFilesSnapshot[index];
var destFileName = Path.Combine(tempPath, Path.GetFileName(sourceFile));
if (!CreateHardLink(destFileName, sourceFile, IntPtr.Zero))
{
// 'The system cannot find the file specified' is explicitly ignored here
if (Marshal.GetLastWin32Error() != 0x80004005)
throw new Win32Exception();
}
}
}
finally
{
Directory.Delete(sourcePath);
Directory.Delete(targetPath);
Directory.Delete(tempPath);
}
}
}
}
为了将我的特定 Web 应用程序也排除在等式之外,我创建了一个新的 Azure 网站并部署了上述相同的可执行文件,它也失败了
<可以公平地假设它们尚未在 ReFS (which does not support hard links) 上运行但仍在使用 NTFS?
tl;博士
Azure 网站上发生了什么变化,导致以前可以正常工作的 [kernel32.dll]CreateHardLink
调用失败?
如何在 RavenDb 代码外部或 RavenDb 代码内部修复此问题...?
最佳答案
更新:此问题现已修复。 CreateHardLink
应该与 D:\home
一起使用路径。
我认为这是 Azure 网站的问题。基本上,当您尝试创建相对路径时,它默认为 D:\home\
。该文件夹实际上并不存在于计算机上,但 Azure 网站为了方便起见伪造了它。然而,这里似乎导致了 CreateHardLink
的问题。功能。
如果您只是更改上面示例中的这一行
const string tempPath = "TestTemp";
到此
const string tempPath = @"C:\DWASFiles\Sites\<sitename>\VirtualDirectory0\site\TestTemp";
替换 <sitename>
与您的网站名称
它会起作用的。
我对 RavenDb 并不是很熟悉,但作为一种解决方法,您可以尝试将这些目录更改为与上面类似的完整路径。我会同时报告该错误。让我知道这是否适合您
关于azure - [kernel32.dll]RavenDb 嵌入式备份期间 Azure 网站上的 CreateHardLink 失败并显示 "Cannot create a file when that file already exists",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23041289/
我正在玩Raven DB几天,我想将其用作Web聊天应用程序的存储。我有包含一些用户数据和聊天记录的文档-这是大集合的聊天消息。 每次加载用户文档时,聊天记录也会加载,即使我只需要几个字段,例如:用户
我的实体是: class Resource { string Name; string EmployeeId; } 如何查询多名员工的资源?我尝试了这个: Resource[] Fin
我知道这篇文章的标题会让一些人感到畏缩。我自 2011 年 12 月以来一直在使用 RavenDB,并且逐渐意识到我以不适合使用文档数据库的方式对数据进行建模。首先,我完全明白这一点。其次,考虑到我目
考虑 2 个查询: var test1 = store.OpenSession().Query().Where(x => x.Id == 1).ToList(); var test2 =
我正在运行 RavenDB.Client 2.0.2173-Unstable。我正在创建一个 Multi-Tenancy 系统,作为我注册过程的一部分,我想创建一个新的 Raven 数据库。 我有三行
我正在使用在 Visual Studio 2010 中通过 NuGet 安装的嵌入式 RavenDB => RavenDB-Embedded.1.0.499 包。它正在我阅读完这篇优秀文章后开始的当前
我们在 AWS 上有一个带有集群 RavenDB 服务器 (5.23) 的 DotNet Core API (C#)。创建文档时,Id 具有不同的格式,具体取决于客户端。如果使用 Swagger/Po
我想知道取回搜索记录总数的最佳方法是什么,同时取回第 N 个 128 记录块数据段,这似乎是 RavenDb 运行时强加的上限。 例如给定这个查询,我还需要知道记录的总数。 var bookmarks
我使用的是 RavenDB 2.0.3.0 版。连接调试器后,涉及 RavenDB 的所有内容都运行得非常缓慢。每个查询需要几秒钟才能完成。 如果我在调试器坐在那里时按下暂停键,我总是看到它挂断了以下
我使用以下代码从 RavenDB 中删除文档。在 Raven UI 的底部,我可以看到文档数量从 3,000,000 减少到 2,000,000。但是“数据”文件的大小不会缩小。它总是大约100G。
我想在我的 Raven DB 中轮询新文档。推荐的方法是什么?我可以使用 IndexTimestamp 还是可以依赖文档的顺序? 我想我想分两步完成: 1.检查是否有新的东西,如果有: 1.1。获取最
我已经更改了我的数据模型,并且需要将所有对象的属性更改为 null,因为在我的模型更改后反序列化它们会引发异常。 我猜我可以为每个文档发布一个补丁,但我找不到任何方法来做到这一点,修补某种类型的每个文
有没有办法在进行空间搜索时从 RavenDB 获取距离计算值。我尝试转换建议的 _ = SpatialIndex.Generate(r.Latitude, r.Longitude) 至 距离 = Sp
是否有一种明智的方法来 stub /模拟调用 IDocumentSession.Query() 的结果? ? 我有一个命令,我想验证在对象上调用了方法(即正在测试的“单元”是命令,而不是命令编排的对象
我想在存储在 RavenDB 文档数据库中的两个实体之间有一个引用。由于这不是关系数据库,我知道我应该使用 RavenDBs 文档中描述的非规范化引用技术。虽然起初这看起来不错,但一旦我开始创建一个真
是否可以使用返回单个文档但不是关键的属性从数据存储加载(而不是查询)文档? 在我的场景中,我有用户和品牌。品牌是用户,但用户不一定是品牌。每个品牌都有一个 UserId 属性及其 Id。有没有办法通过
通过官方 RavenDB 阅读一个简单的问题 documentation ,我知道您可以使用客户端 API 函数执行这些操作,但不能使用 RQL,或者无论如何都可以使用 RQL 执行。 最佳答案 您正
我正尝试在 RavenDB 中检索我按 int 列表排序的文档。 Queryable = Queryable.OrderBy(dto => SearchIds.IndexOf(dto.Property
我刚刚让 RavenDB 开始工作。 我意识到我必须启动 RavenDB\packages\RavenDB.1.0.573\server.exe 才能通过以下方式在我的应用程序中访问它: Do
RavenDB 是否有众所周知的做法来检查 RavenDb 的可用性或检查它在任何给定时间的过载程度?我研究了一些 ravendb API 服务。好像没找到关于健康监测的。有没有像官方的 ravend
我是一名优秀的程序员,十分优秀!