【问题标题】:Parse.Initialize throws IOException with Parse .NET SDK on .NET Core 2.2 hosted on HerokuParse.Initialize 在 Heroku 上托管的 .NET Core 2.2 上使用 Parse .NET SDK 引发 IOException
【发布时间】:2019-03-10 08:03:57
【问题描述】:

以下代码

ParseClient.Initialize (new ParseClient.Configuration
{
    ApplicationID = "APPID",
    Key = ".NET KEY",
    ServerURI = "SERVER URL"
});

抛出System.IO.IOException: The file '/app/heroku_output/[HEROKU APP NAME]' already exists.

堆栈跟踪:

at System.IO.FileSystem.CreateDirectory(String fullPath)
at System.IO.Directory.CreateDirectory(String path)
at Parse.Internal.Utilities.StorageManager.get_PersistentStorageFileWrapper()
at Parse.Common.Internal.StorageController..ctor()
at Parse.Core.Internal.ParseCorePlugins.get_StorageController()
at Parse.Core.Internal.ParseCorePlugins.get_CurrentUserController()
at Parse.Core.Internal.ParseCorePlugins.<get_SubclassingController>b__54_0()
at Parse.Core.Internal.ObjectSubclassingController.RegisterSubclass(Type type)
at Parse.ParseClient.Initialize(Configuration configuration)
at api.Startup.ConfigureServices(IServiceCollection services) in /tmp/build_ee0c61a720b09ce072787bbc64b4001d/Startup.cs:line 50

【问题讨论】:

  • 您使用的服务器 URL 是什么?
  • @nataliec 我正在使用 https://parseapi.back4app.com/ 这一切都在本地工作,但不在 Heroku 上。

标签: c# heroku parse-platform .net-core back4app


【解决方案1】:

Heroku 不允许将任何内容写入文件系统 https://help.heroku.com/K1PPS2WM/why-are-my-file-uploads-missing-deleted

【讨论】:

  • 感谢您的回复,但我认为情况并非如此。您链接到的页面仅说明在回收测功机时会删除写入的文件,而不是禁止写入文件系统。在这种情况下,在我不确切知道的情况下,我敢打赌它会尝试存储某种会话状态,因此这发生在 init 方法中,并且随着 init 方法在每次启动时运行,这些文件被回收没有问题。
  • 能否在 Github 上分享一个关于 bug 重现的示例?
猜你喜欢
  • 1970-01-01
  • 2019-12-11
  • 2018-02-17
  • 2019-07-08
  • 1970-01-01
  • 2019-05-18
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多