question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could not acquire lock on /tmp/uia2_device_port_guard

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
sshockcommented, Sep 3, 2020

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.

0reactions
ShouryaMishra712commented, Oct 27, 2020

I just removed ‘uia2_device_port_guard’ file from the path ‘C:\Users\shm71\AppData\Local\Temp\uia2_device_port_guard’ and the error is gone…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Could not acquire lock on uia2_device_port_guard. File ...
I am new in Appium. I run my app from last 3 weeks by using this code. suddenly when I run this from...
Read more >
Could not acquire lock - TIBCO Support
When several procedures are executed simultaneously, the performances of the application can be degraded and such a message will appear in ...
Read more >
could not acquire lock on @Synchronized, help me. - JBoss.org
Sometime my STSB's throws this error to log files on server. Can anybody help me to resolve problem? What can't be wrong? Caused...
Read more >
Getting a Unable to aquire lock error message when opening ...
Resolving The Problem​​ This error is due to corruption in the locks. log and logins. log files.
Read more >
Could not get lock /var/lib/dpkg/lock' Error in Ubuntu Linux
In fact, there is a similar error you may see: E: Could not get lock /var/lib/apt/lists/lock – open (11: Resource temporarily unavailable)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found