zebrunner / appium

Enhanced Appium for Elastic Selenium Grid/MCloud services
8 stars 3 forks source link

do exit 0 for `ENOSPC: no space left on device, mkdir '/tmp/...` error #317

Closed vdelendik closed 7 months ago

vdelendik commented 10 months ago

space is ok either for server so for device but appium can't generate temp folder https://stackoverflow.com/questions/13758877/how-do-i-find-out-what-inotify-watches-have-been-registered https://unix.stackexchange.com/questions/498393/how-to-get-the-number-of-inotify-watches-in-use

increasing such settings didn't help (not sure if containers restart needed)

sysctl fs.inotify fs.inotify.max_queued_events = 16384 fs.inotify.max_user_instances = 128 fs.inotify.max_user_watches = 8192

->

sysctl fs.inotify fs.inotify.max_queued_events = 16384 fs.inotify.max_user_instances = 256 fs.inotify.max_user_watches = 16384

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: ENOSPC: no space left on device, mkdir '/tmp/2023113-92-1kzagxp.qijh'[[[--udid R..M --name Samsung_Tab_A --sessionId a757a989-9227-48c5-91d8-e145043e211c]]]
Host info: host: 'ip-10-199-0-165.ec2.internal', ip: '10.199.0.165'
Build info: version: '4.7.0', revision: '0a5b49d16f'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.198-187.748.amzn2.x86_64', java.version: '17.0.8'
Driver info: io.appium.java_client.android.AndroidDriver
Command: [null, newSession {capabilities=[{appium:deviceType=Tablet, appium:provider=zebrunner, appium:custom_env=PROD, appium:enableVideo=true, appium:newCommandTimeout=50000, appium:locale=US, appium:enforceAppInstall=true, appium:language=en, appium:remoteAppsCacheLimit=0, appium:androidInstallTimeout=120000, appium:automationName=UIAutomator2, appium:fullReset=false, appium:enableLog=true, appium:enableAdb=true, appium:adbExecTimeout=120000, appium:enableVnc=false, appium:deviceName=...
vavadikb commented 7 months ago

ticket was resolved in pull request https://github.com/zebrunner/appium/pull/333

vavadikb commented 7 months ago

changes was tested successfully by akamarouski

vavadikb commented 7 months ago

Testing steps:

  1. build appium from this fix public.ecr.aws/zebrunner/appium:2.0.12-beta3
  2. you need to fill the free space on device by downloading any big files for example big csv/apk or during screen recording
  3. and when there is no free space on device you can run any java test

it should returns ENOSPC error, no space left on device and exit by code 1

vavadikb commented 7 months ago

decided to change exit code from 1 to 0 to avoid restarting the container

vavadikb commented 7 months ago

ticket was resolved in pull request in pull request https://github.com/zebrunner/appium/pull/341

dhreben commented 7 months ago

Tested onAPPIUM_VERSION: 2.0.12 We're catching Exit status: 0 , but device container still restarting and after that device is available in STF

Container :

8ecb6fc4018c public.ecr.aws/zebrunner/mcloud-device:2.6.4-beta15 "/bin/sh -c 'bash /o…" 27 minutes ago Restarting (1) 1 second ago

Appium log:

2024-02-28 14:04:00:167 - [ADB] The application at '/opt/appium-storage/wp-content/uploads/2022/11/26/637d602b5f8aa/com.tunnelbear.android_3.7.0-803070001_minAPI21(arm64-v8a,armeabi-v7a,x86,x86_64)(nodpi)_apkmirror.com.apk' will not be cached, because the device under test has confirmed the support of streamed installs
2024-02-28 14:04:00:545 - [ADB] The installation of 'appium-uiautomator2-server-debug-androidTest.apk' took 1611ms
2024-02-28 14:04:01:483 - [AndroidUiautomator2Driver@aa76 (1ec99ec7)] Did not get confirmation UiAutomator2 deleteSession worked; Error was: UnknownError: An unknown server-side error occurred while processing the command. Original error: Trying to proxy a session command without session id
- [BaseDriver] ENOSPC error, no space left on device, Error message:Error executing adbExec. Original error: 'Command '/opt/android/platform-tools/adb -P 5037 -s 03157df3fb7a6915 install -r /usr/lib/node_modules/appium/node_modules/appium-uiautomator2-driver/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v7.0.1.apk' exited with code 1'; Command output: adb: failed to install /usr/lib/node_modules/appium/node_modules/appium-uiautomator2-driver/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v7.0.1.apk: Failure [INSTALL_FAILED_INSUFFICIENT_STORAGE]
[[[--udid 03157df3fb7a6915 --name Samsung_Galaxy_S6_2 --sessionId 1ec99ec7-cdba-4ce7-8f57-788c1a5bfdb4]]] appium exit with code 0
2024-02-28 14:04:02:962 - [BaseDriver] [MCLOUD] process.on('exit'). Deleting files by path: /opt/appium-storage/wp-content/uploads/2022/11/26/637d602b5f8aa/com.tunnelbear.android_3.7.0-803070001_minAPI21(arm64-v8a,armeabi-v7a,x86,x86_64)(nodpi)_apkmirror.com.apk
Exit status: 0
exit_code: 0
dhreben commented 7 months ago

Closed according a relevant ticket https://github.com/zebrunner/mcloud-device/issues/189