"*.apk does not exist or is not accessible" on Ubuntu but works on Windows

For context, I have setup a Selenium Grid Hub on the same Ubuntu machine. I also have 2 nodes (1 win and one macOS) - The windows node has 2 Android devices connected
On the same Ubuntu machine, I am trying to set the .apk path to the following: /media/daniel/BrokenEyes/builds/***.***.***.apk

However if I run the following command:
pytest path/to/test_folder --apk_path '/media/daniel/BrokenEyes/builds/***.***.***.apk'

the --apk_path is a custom argument I have made

def pytest_addoption(parser):  # If you change these, change the ones in Rabbit_Sender too
    parser.addoption("--apk_path", action="store", default=None,
                     help="Path to the APK file for Android Devices")

def apk_path(request):
    return request.config.getoption("--apk_path")

def mobile_driver(request, device_info, device_orientation, apk_path, ipa_path, version_no, device_name_local):
    test_name = request.node.name
    device_platform, device_name, device_version, device_mobile_driver = device_info
    orientation = device_orientation
    options = AppiumOptions()
    caps = {
        'platformName': device_platform,
        #'appium:deviceName': device_name,
        'appium:app': apk_path,
        'appPackage': 'com.***.***',  # Todo Confirm this is the same for iOS
        'appActivity': ***.SplashActivity',
        'appium:platformVersion': device_version,
        'appium:automationName': device_mobile_driver,
        'appium:ensureWebviewsHavePages': True,
        'appium:nativeWebScreenshot': True,
        'appium:newCommandTimeout': 3600,
        'appium:connectHardwareKeyboard': True,
        'appium:fullReset': True
    if device_name:
        caps['appium:deviceName'] = device_name
    url = 'http://ipaddress:4444/wd/hub'
    mobile_driver = webdriver.Remote(command_executor=url, options=options)
    mobile_driver.orientation = orientation
    # Yield the mobile_driver to the test
    yield mobile_driver

I get the error:
`The application at ‘/media/daniel/BrokenEyes/builds/***.***.***.apk’ does not exist or is not accessible

I get this error regardless of where the .apk file is stored on the Ubuntu machine, I have tried:

  • Placing the .apk file in the Home folder
  • Placing the .apk file in the working directory where the path/to/test_folder is running

I don’t think its an issue with either the Selenium Grid hub or node, as I can run the pytest path/to/test_folder --apk_path 'path/to/***.***.***.apk' on a separate Windows 10 machine (Changing the path to where the APK is stored on the Windows machine and both of the android devices on the Windows node start running the tests

I’m confident its the way I’ve set the file path on the Ubuntu machine, I don’t think it is permissions as it cannot run it anywhere I put the apk file.

Does anyone have any ideas what is going on here?