EBUSY: resource busy or locked; Not able to attach log to file
维护者通常 5 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 AppiumDriverLocalService.buildService 和 AppiumServiceBuilder.withLogFile 入手,然后在 Windows 10 上使用现有的 Server.logs 文件重现以编程方式启动/停止的流程。跟踪服务在启动和停止期间如何处理日志路径。完成的标准是,重复启动服务时不再报告 EBUSY,同时日志输出仍然可用。
由索引模型根据 Issue 内容生成。
描述
Description
Getting below issue:
Tried to attach logging to file 'D:\Automation-Framework\Generic\generic\Logs\Server.logs' but an error occurred: EBUSY: resource busy or locked, unlink 'D:\Automation-Framework\Generic\generic\Logs\Server.logs'
Environment
- Java client build version or git revision if you use some snapshot: 8.5.1
- Appium server version or git revision if you use some snapshot: 2.1.3
- Desktop OS/version used to run Appium if necessary: Windows 10
- Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe: v18.18.0
- Mobile platform/version under test: Android
- Real device or emulator/simulator:
Details
I am starting and stopping the Appium server programmatically and this is working properly. The Appium logs displayed properly in console. but when tried to capture this log into file as that time I am getting error EBUSY: resource busy or locked. Folder Logs and file Server.logs is present.
Code To Reproduce Issue [ Good To Have ]
private AppiumDriverLocalService getAppiumDriverService() {
return AppiumDriverLocalService.buildService(new AppiumServiceBuilder()
.withIPAddress("127.0.0.1")
.usingPort(DEFAULT_APPIUM_SERVER_PORT)
.withArgument(GeneralServerFlag.BASEPATH, "/wd/hub/")
.withArgument(GeneralServerFlag.USE_DRIVERS, "UiAutomator2")
.withArgument(GeneralServerFlag.ALLOW_INSECURE, "adb_shell")
.withArgument(GeneralServerFlag.RELAXED_SECURITY)
.withArgument(GeneralServerFlag.USE_PLUGINS, "images")
.withArgument(GeneralServerFlag.SESSION_OVERRIDE)
.withArgument(GeneralServerFlag.LOG_LEVEL, "info")
.withLogFile(new File(System.getProperty("user.dir") + File.separator + "Logs" + File.separator + "Server.logs")));
}
Appium Server Log:
Tried to attach logging to file 'D:\Automation-Framework\Generic\generic\Logs\Server.logs' but an error occurred: EBUSY: resource busy or locked, unlink 'D:\Automation-Framework\Generic\generic\Logs\Server.logs'
[Appium] Attempting to load plugin images...
[Appium] Welcome to Appium v2.1.3
[Appium] Non-default server args:
[Appium] { address: '127.0.0.1',
[Appium] allowInsecure: [ 'adb_shell' ],
[Appium] basePath: '/wd/hub/',
[Appium] loglevel: 'info',
[Appium] relaxedSecurityEnabled: true,
[Appium] sessionOverride: true,
[Appium] useDrivers: [ 'UiAutomator2' ],
[Appium] usePlugins: [ 'images' ] }
[Appium] Appium REST http interface listener started on http://127.0.0.1:4723/wd/hub
[Appium] Available drivers:
[Appium] - [email protected] (automationName 'UiAutomator2')
[Appium] - [email protected] (automationName 'Espresso')
[Appium] Available plugins:
[Appium] - [email protected] (ACTIVE)
[Appium] - [email protected]
[HTTP] --> GET /wd/hub/status
[HTTP] {}
[AppiumDriver@19a4] Plugins which can handle cmd 'getStatus': images
[AppiumDriver@19a4] Plugin images is now handling cmd 'getStatus'
[AppiumDriver@19a4] Executing default handling behavior for command 'getStatus'
APPIUM SERVER STARTED
[HTTP] <-- GET /wd/hub/status 200 6 ms - 110
[HTTP]
- 主要语言
- Java
- 星标
- 1.3k
- 派生
- 755
- 平均合并
- 5 天 14 小时
- 30 天内合并 PR
- 8
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
appium/java-client 的其他 Issue
-
难度 5/5 一周以上 新手友好度 25/100
appium/java-client#2426 ·
维护者通常 5 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 50/100
appium/java-client#2372 ·
维护者通常 5 天内回复
-
难度 5/5 一周以上 新手友好度 30/100
appium/java-client#2368 ·
维护者通常 5 天内回复
-
难度 2/5 1-3 小时 新手友好度 30/100
appium/java-client#2341 · 1 条评论 ·
维护者通常 5 天内回复
-
难度 5/5 一周以上 新手友好度 15/100
appium/java-client#2323 ·
维护者通常 5 天内回复
查看 appium/java-client 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
-
component/zeebe kind/bug
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
UniversalMediaServer/UniversalMediaServer#6356 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
refinedmods/refinedstorage2#1414 · 1 条评论 ·
-
难度 1/5 1-3 小时 新手友好度 88/100
yegor256/rultor-image#76 · 1 条评论 ·