首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 數據庫知識 >  >> SQL Server 資料庫 >> 關於SqlServer

SQL Server Agent 作業呼叫 Kettle Job 失敗快速修復:.kettle 目錄缺失導致 VFS 錯誤

     編輯:關於SqlServer

錯誤現象

Unable to list jar files in plugin folder 'C:\Windows\system32\config\systemprofile\.kettle\plugins'
Unable to get VFS File object for filename 'C:\Windows\system32\config\systemprofile\.kettle\plugins'
: Could not find file with URI ... because it is a relative path, and no base URI was provided.
進程退出代碼 0。該步驟成功。

表面顯示「步驟成功」,實則 Kettle 核心拋出 VFS 異常,轉換/作業未真正執行。

根因分析

  • Kettle (PDI) 預設將配置檔(kettle.properties、repositories.xml、plugins 等)存放於 當前使用者目錄:C:\Users\Administrator\.kettle\。
  • SQL Server Agent 服務預設以 Local System (SYSTEM) 身分執行,其使用者配置目錄為 C:\Windows\System32\config\systemprofile\。
  • Agent 啟動 Kettle 時,Kettle 在 SYSTEM 的 .kettle 目錄找不到配置 → VFS 解析失敗。

一鍵修復方案

  1. 以管理員身分開啟檔案總管。
  2. 複製 完整 C:\Users\Administrator\.kettle 目錄。
  3. 貼上至 C:\Windows\System32\config\systemprofile\(目標若已存在 .kettle 則直接覆蓋合併)。
  4. 重新執行 Agent 作業驗證。

進階:指定 KETTLE_HOME 環境變數(更優雅)

  1. 建立共用目錄:D:\Kettle_Shared\.kettle。
  2. 將開發機 .kettle 複製至此。
  3. 系統環境變數新增:KETTLE_HOME = D:\Kettle_Shared\.kettle(系統變數,對所有用戶含 SYSTEM 生效)。
  4. 重啟 SQL Server Agent 服務生效。

優點:避免雙邊同步,集中管理配置,支援多 Agent 節點共享。

驗證清單

  • [ ] C:\Windows\System32\config\systemprofile\.kettle\kettle.properties 存在。
  • [ ] plugins 目錄存在且可讀。
  • [ ] Agent 作業日誌無 VFS 錯誤,Kettle 正常輸出轉換日誌。

總結

「用戶配置目錄不匹配服務執行身分」是跨平台調度工具(Kettle、Python 虛擬環境、Node npm 全域包等)常見坑。修復核心:**讓服務身分能讀到所需配置目錄**,或以環境變數統一指向共用路徑。

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved