错误:无法打开INI文件。错误:SharpConfig.ParserException:第7277行缺少右括号

我最近從 2.4.6 升級到 2.4.7(接著又升級到 2.4.8 beta,試圖解決這個問題,但問題依舊存在)。MCEBuddy 看起來安裝成功,服務也能啟動,但沒有任何檔案被掃描到(我也手動把新檔案放到監控目錄裡測試)。以下錯誤在 log 中重複出現(mcebuddy.log,沒有其他 log 檔案被產生,歷史紀錄也是空的):

INFORMATION> --> MCEBuddy Running as Service : True
ERROR> --> Unable to open INI file. Error : SharpConfig.ParserException: Line 7277: closing bracket missing.
   at SharpConfig.ConfigurationReader.ParseSection(String line, Int32 lineNumber)
   at SharpConfig.ConfigurationReader.Parse(StringReader reader, Configuration config)
   at SharpConfig.ConfigurationReader.ReadFromString(String source)
   at MCEBuddy.Util.Ini..ctor(String file)
ERROR> 2017-08-03T18:55:18 MCEBuddy.Engine.QueueManager --> Unable to search for files in location <REDACTED> for monitor task <REDACTED>
ERROR : Value cannot be null.
Parameter name: source
ERROR> --> Unable to open INI file. Error : SharpConfig.ParserException: Line 7277: closing bracket missing.
   at SharpConfig.ConfigurationReader.ParseSection(String line, Int32 lineNumber)
   at SharpConfig.ConfigurationReader.Parse(StringReader reader, Configuration config)
   at SharpConfig.ConfigurationReader.ReadFromString(String source)
   at MCEBuddy.Util.Ini..ctor(String file)
ERROR> 2017-08-03T18:55:18 MCEBuddy.Engine.QueueManager --> Unable to search for files in location <REDACTED> for monitor task <REDACTED>
ERROR : Value cannot be null.
Parameter name: source
ERROR> --> Unable to open INI file. Error : SharpConfig.ParserException: Line 7277: closing bracket missing.
   at SharpConfig.ConfigurationReader.ParseSection(String line, Int32 lineNumber)
   at SharpConfig.ConfigurationReader.Parse(StringReader reader, Configuration config)
   at SharpConfig.ConfigurationReader.ReadFromString(String source)
   at MCEBuddy.Util.Ini..ctor(String file)
ERROR> 2017-08-03T19:16:40 MCEBuddy.Engine.QueueManager --> Unable to search for files in location <REDACTED> for monitor task <REDACTED>
ERROR : Value cannot be null.
Parameter name: source
ERROR> --> Unable to open INI file. Error : SharpConfig.ParserException: Line 7277: closing bracket missing.
   at SharpConfig.ConfigurationReader.ParseSection(String line, Int32 lineNumber)
   at SharpConfig.ConfigurationReader.Parse(StringReader reader, Configuration config)
   at SharpConfig.ConfigurationReader.ReadFromString(String source)
   at MCEBuddy.Util.Ini..ctor(String file)
ERROR> 2017-08-03T19:16:40 MCEBuddy.Engine.QueueManager --> Unable to search for files in location <REDACTED> for monitor task <REDACTED>
ERROR : Value cannot be null.
Parameter name: source

看起来您的配置 INI 文件无效。某个节名缺少右括号。请附上配置文件,或者考虑重新安装。

感謝你的建議。其實是「history」檔的問題。我花了很多時間排查並更換設定檔與設定檔,但都沒用。原來是 history 檔裡某一行出現了奇怪的拉丁字碼頁字元,導致問題發生。

如果容許我提出幾點建議:

  • 如果錯誤日誌也能印出解析失敗的檔案名稱,會很有幫助
  • 此外,若可行的話,或許可以輸出解析程式庫的除錯/錯誤日誌?這樣應該會印出關於出問題的行、字元的資訊,有助於精準定位問題

很棒的程式,繼續加油!

好建议。

如果您有历史文件,请将其发送给我们,以便我们进行分析并将其添加到我们的测试套件中。

好的,我不确定该用哪个邮箱地址,所以我已经通过私信把文件发给你了。

MCEbuddy 整个下午都运行正常,编码了一堆文件,可当我尝试重新转换这些文件时,却突然弹出与楼主相同的错误。无论是点“添加”还是拖放都不行,日志里报的就是上面提到的错误。真奇怪。

编辑:于是我尝试修复安装,结果提示已存在而失败,说已取消。重启后发现所有配置文件都没了,靠!真他妈烦人。

错误依旧:
ERROR → 无法打开 INI 文件。错误:SharpConfig.ParserException: 第 1 行:缺少设置赋值。
在 SharpConfig.ConfigurationReader.ParseSetting(String line, Int32 lineNumber)
在 SharpConfig.ConfigurationReader.Parse(StringReader reader, Configuration config)
在 SharpConfig.ConfigurationReader.ReadFromString(String source)
在 MCEBuddy.Util.Ini..ctor(String file)

你的配置文件已损坏。请进行全新安装。

遇到和原發文者相同的錯誤。我已經做了兩次全新安裝,仍然無效。
我已附上 MCEbuddy.log

mcebuddy.log (52.7 KB)

這表示設定檔已損毀。當你說你做了全新安裝時,你只是解除安裝後再重新安裝,還是依照這裡的步驟進行?

我還注意到你把根目錄設為 Z:\\ —— 你確定這是你想要的嗎?因為 MCEBuddy 似乎沒有該根資料夾的權限:

ERROR> 2018-05-20T10:59:27 MCEBuddy.Engine.QueueManager → Unable to search for files in location Z:\ for monitor task All Rec