Skip to content

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

@dipakkumar1225

Description

@dipakkumar1225

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]   - uiautomator2@2.29.9 (automationName 'UiAutomator2')
[Appium]   - espresso@2.25.7 (automationName 'Espresso')
[Appium] Available plugins:
[Appium]   - images@2.1.4 (ACTIVE)
[Appium]   - element-wait@2.0.3
[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] 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions