Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-12120

Emulator startup shouldn't fail when .ini is missing

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      17:14:47  [android] Starting Android emulator
      17:14:47  [android] Erasing existing emulator data...
      17:14:47  $ /Users/buildserver/Android/sdk/tools/emulator -no-boot-anim -ports 58108,58109 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_841x490_android-7 -no-snapshot-load -no-snapshot-save -wipe-data -no-window -no-snapshot-update-time
      17:14:50  PANIC: Could not open: /tmp/jenkins-root-ssh/workspace/client_android_staging_test/.android/avd/hudson_en-US_160_841x490_android-7.ini* daemon not running. starting it now on port 58110 *
      17:14:50  * daemon started successfully *
      17:15:52  [android] Emulator did not appear to start; giving up
      

      I'm guessing the code tests for a .avd but not a .ini - I don't know how my machine managed to end up with only a .avd (I checked, and it existed), but in that scenario, the plugin should probably recreate the emulator (android create avd -f).

        Attachments

          Activity

          Hide
          francisdb francisdb added a comment -

          Is there a workaround for this issue?

          Show
          francisdb francisdb added a comment - Is there a workaround for this issue?
          Hide
          orrc Christopher Orr added a comment -

          Did this happen to an existing emulator, or was it created during the build where you saw this error?

          Probably you can delete the emulator and try again.

          Show
          orrc Christopher Orr added a comment - Did this happen to an existing emulator, or was it created during the build where you saw this error? Probably you can delete the emulator and try again.
          Hide
          francisdb francisdb added a comment -

          It seems that the emulator is not created at all

          [android] Using Android SDK: /opt/android-sdk-linux
          [android] Creating Android AVD: /var/lib/jenkins/.android/avd/hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.avd

          /var/lib/jenkins/.android/avd is empty

          Show
          francisdb francisdb added a comment - It seems that the emulator is not created at all [android] Using Android SDK: /opt/android-sdk-linux [android] Creating Android AVD: /var/lib/jenkins/.android/avd/hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.avd /var/lib/jenkins/.android/avd is empty
          Hide
          orrc Christopher Orr added a comment -

          Sounds like a different bug.

          Can you paste more of the console output somewhere; in a new bug if you're not seeing the "PANIC: Could not open ... .ini" message?

          Show
          orrc Christopher Orr added a comment - Sounds like a different bug. Can you paste more of the console output somewhere; in a new bug if you're not seeing the "PANIC: Could not open ... .ini" message?
          Hide
          francisdb francisdb added a comment - - edited

          Logs look similar, nothing mentioned about creating the avd failing, and the command used is not logged, otherwise I could try it manually.

          Checking out Revision f8d74574069d0aac99890ca930a166c948729f6b (origin/HEAD, origin/master)
          Warning : There are multiple branch changesets here
          $ /opt/android-sdk-linux/tools/android list target
          [android] Using Android SDK: /opt/android-sdk-linux
          [android] Creating Android AVD: /var/lib/jenkins/.android/avd/hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.avd
          $ /opt/android-sdk-linux/platform-tools/adb start-server
          [android] Starting Android emulator
          $ /opt/android-sdk-linux/tools/emulator -no-boot-anim -ports 55292,32849 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7 -no-snapshot-load -no-snapshot-save -no-window -logcat *:d
          PANIC: Could not open: /var/lib/jenkins/.android/avd/hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.ini* daemon not running. starting it now on port 33012 *
          * daemon started successfully *
          [android] Emulator did not appear to start; giving up
          $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:32849
          [android] Stopping Android emulator
          $ /opt/android-sdk-linux/platform-tools/adb kill-server
          Recording test results
          No test report files were found. Configuration error?
          Emma: looking for coverage reports in the provided path: **/coverage/coverage*.xml
          Finished: NOT_BUILT
          
          Show
          francisdb francisdb added a comment - - edited Logs look similar, nothing mentioned about creating the avd failing, and the command used is not logged, otherwise I could try it manually. Checking out Revision f8d74574069d0aac99890ca930a166c948729f6b (origin/HEAD, origin/master) Warning : There are multiple branch changesets here $ /opt/android-sdk-linux/tools/android list target [android] Using Android SDK: /opt/android-sdk-linux [android] Creating Android AVD: / var /lib/jenkins/.android/avd/hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.avd $ /opt/android-sdk-linux/platform-tools/adb start-server [android] Starting Android emulator $ /opt/android-sdk-linux/tools/emulator -no-boot-anim -ports 55292,32849 -prop persist.sys.language=en -prop persist.sys.country=US -avd hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7 -no-snapshot-load -no-snapshot-save -no-window -logcat *:d PANIC: Could not open: / var /lib/jenkins/.android/avd/hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.ini* daemon not running. starting it now on port 33012 * * daemon started successfully * [android] Emulator did not appear to start; giving up $ /opt/android-sdk-linux/platform-tools/adb disconnect localhost:32849 [android] Stopping Android emulator $ /opt/android-sdk-linux/platform-tools/adb kill-server Recording test results No test report files were found. Configuration error? Emma: looking for coverage reports in the provided path: **/coverage/coverage*.xml Finished: NOT_BUILT
          Hide
          orrc Christopher Orr added a comment -

          Can you check if "hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.avd" was created anywhere on disk, not just in /var/lib/jenkins/.android/avd?

          Sometimes there can be a conflict between where the plugin looks for AVDs and where the `android` tool creates them.

          Show
          orrc Christopher Orr added a comment - Can you check if "hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.avd" was created anywhere on disk, not just in /var/lib/jenkins/.android/avd? Sometimes there can be a conflict between where the plugin looks for AVDs and where the `android` tool creates them.
          Hide
          francisdb francisdb added a comment -

          Have not found any avd, could you tell me the command used by the plugin to create the avd so I can try to reproduce this?

          Show
          francisdb francisdb added a comment - Have not found any avd, could you tell me the command used by the plugin to create the avd so I can try to reproduce this?
          Hide
          francisdb francisdb added a comment -

          Nothing I can do to debug this?

          Show
          francisdb francisdb added a comment - Nothing I can do to debug this?
          Hide
          orrc Christopher Orr added a comment -

          The command used for that AVD would be (assuming an SD card of 16MB):

          android create avd -a -c 16M -s WVGA -n hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.avd -t "Google Inc.:Google APIs:7"

          Show
          orrc Christopher Orr added a comment - The command used for that AVD would be (assuming an SD card of 16MB): android create avd -a -c 16M -s WVGA -n hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.avd -t "Google Inc.:Google APIs:7"
          Hide
          francisdb francisdb added a comment -

          I found the issue

          /opt/android-sdk-linux/tools/android create avd -a -c 16M -s WVGA -n hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.avd -t "Google Inc.:Google APIs:7"
          Valid skins: WVGA854, WQVGA400, HVGA, WQVGA432, QVGA, WVGA800 (default)
          Error: 'WVGA' is not a valid skin name or size (NNNxMMM)
          

          After that I tried this on the console:

          /opt/android-sdk-linux/tools/android create avd -a -c 16M -s WVGA800 -n hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.avd -t "Google Inc.:Google APIs:7"
          Auto-selecting single ABI armeabi
          Error: Unable to find a '/opt/android-sdk-linux/tools/lib/emulator/snapshots.img' file to copy into the AVD folder.
          

          This was a permission issue where the folder was not accessible (missing +x persmission).

          Could you make sure the plugin shows the error output in the future?

          Show
          francisdb francisdb added a comment - I found the issue /opt/android-sdk-linux/tools/android create avd -a -c 16M -s WVGA -n hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.avd -t "Google Inc.:Google APIs:7" Valid skins: WVGA854, WQVGA400, HVGA, WQVGA432, QVGA, WVGA800 ( default ) Error: 'WVGA' is not a valid skin name or size (NNNxMMM) After that I tried this on the console: /opt/android-sdk-linux/tools/android create avd -a -c 16M -s WVGA800 -n hudson_en-US_160_WVGA_Google_Inc._Google_APIs_7.avd -t "Google Inc.:Google APIs:7" Auto-selecting single ABI armeabi Error: Unable to find a '/opt/android-sdk-linux/tools/lib/emulator/snapshots.img' file to copy into the AVD folder. This was a permission issue where the folder was not accessible (missing +x persmission). Could you make sure the plugin shows the error output in the future?
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christopher Orr
          Path:
          src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java
          http://jenkins-ci.org/commit/android-emulator-plugin/21b1693bafc80a989a31f7b08290f9492ed1d4c1
          Log:
          [FIXED JENKINS-12120] Check for config.ini before starting or after creating AVD.

          Also show error output if AVD creation fails for some unknown reason.

          This allows the plugin to detect and recover from incorrectly-created AVDs;
          existing AVDs found without a config.ini file will be replaced with a new AVD.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christopher Orr Path: src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java http://jenkins-ci.org/commit/android-emulator-plugin/21b1693bafc80a989a31f7b08290f9492ed1d4c1 Log: [FIXED JENKINS-12120] Check for config.ini before starting or after creating AVD. Also show error output if AVD creation fails for some unknown reason. This allows the plugin to detect and recover from incorrectly-created AVDs; existing AVDs found without a config.ini file will be replaced with a new AVD.
          Hide
          dogfood dogfood added a comment -

          Integrated in plugins_android-emulator #28
          [FIXED JENKINS-12120] Check for config.ini before starting or after creating AVD. (Revision 21b1693bafc80a989a31f7b08290f9492ed1d4c1)

          Result = SUCCESS
          Christopher Orr :
          Files :

          • src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java
          Show
          dogfood dogfood added a comment - Integrated in plugins_android-emulator #28 [FIXED JENKINS-12120] Check for config.ini before starting or after creating AVD. (Revision 21b1693bafc80a989a31f7b08290f9492ed1d4c1) Result = SUCCESS Christopher Orr : Files : src/main/java/hudson/plugins/android_emulator/EmulatorConfig.java
          Hide
          orrc Christopher Orr added a comment -

          This has been released in version 2.2 of the plugin.

          Show
          orrc Christopher Orr added a comment - This has been released in version 2.2 of the plugin.

            People

            • Assignee:
              orrc Christopher Orr
              Reporter:
              jorgenpt Jørgen Tjernø
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: