appium: Could not acquire lock on /tmp/uia2_device_port_guard

The problem

I’m seeing this error a lot in appium.log after upgrading to appium 1.18.0. I never saw it before when running appium 1.17.1. Is it serious or can it be safely ignored?

[UiAutomator2] Unable to remove system port forward: Could not acquire lock on /tmp/uia2_device_port_guard. Original error: Error: EEXIST: file already exists, open '/tmp/uia2_device_port_guard'

Environment

  • Appium version (or git revision) that exhibits the issue: 1.18.0
  • Last Appium version that did not exhibit the issue (if applicable): 1.17.1
  • Desktop OS/version used to run Appium: Ubuntu 18.04
  • Node.js version (unless using Appium.app|exe): 10.22.0
  • Npm or Yarn package manager: npm 6.14.6
  • Mobile platform/version under test: android
  • Real device or emulator/simulator: real
  • Appium CLI or Appium.app|exe: cli

Details

There are no timestamps in appium.log, so it’s hard to tell exactly how often this is occurring, but on one server it shows up in the log 206 times, which is over a course of two or three weeks maybe. On all my other appium 1.18.0 servers it has only occurred about 5-10 times. On my appium 1.17.1 servers it has never occurred.

Link to Appium logs

This is the log from the server where it occurred over 200 times:

https://gist.github.com/sshock/afa15b1d2b32944e6aee227475ce8f60

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (9 by maintainers)

Most upvoted comments

This appears to be working. After updating to the new appium, I then created the lock file manually and then started appium and the file went away and I was able to connect to several devices no problem.