Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

EBUSY: resource busy or locked; Not able to attach log to file

未关闭
#2,021 11 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 5 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java
领域
tooling

调研方向

从 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 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

appium/java-client 的其他 Issue

查看 appium/java-client 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。