Closed Bug 1550069 Opened 5 years ago Closed 4 years ago

'./mach android-emulator --force-update' fails: OSError: [Errno 2] No such file or directory (on ini file)

Categories

(Firefox for Android Graveyard :: Testing, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gbrown, Assigned: gbrown)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

gbrown@mozpad2:~/src$ ./mach android-emulator --force-update
 0:00.28 Fetching and installing AVD. This may take a few minutes...
Error running mach:

    ['android-emulator', '--force-update']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

OSError: [Errno 2] No such file or directory

  File "/home/gbrown/src/mobile/android/mach_commands.py", line 662, in emulator
    emulator.update_avd(force_update)
  File "/home/gbrown/src/testing/mozbase/mozrunner/mozrunner/devices/android_device.py", line 525, in update_avd
    self._update_avd_paths()
  File "/home/gbrown/src/testing/mozbase/mozrunner/mozrunner/devices/android_device.py", line 660, in _update_avd_paths
    os.rename(ini_file, ini_file_new)
gbrown@mozpad2:~/src$ 

I have 2 files associated with this avd:

AVDs-x86-android-7.0-build-2019-04-23.checksum
AVDs-x86-android-7.0-build-2019-04-23.tar.gz

Work-around:

rm AVDs-x86-android-7.0-build-2019-04-23.checksum
./mach android-emulator --force-update

(which re-creates AVDs-x86-android-7.0-build-2019-04-23.checksum)

gbrown@mozpad2:~/src$ ./mach android-emulator --verbose --force-update
DEBUG: Running on Linux-4.15.0-48-generic-x86_64-with-Ubuntu-18.04-bionic
DEBUG: Emulator created with type x86-7.0
DEBUG: emulator found at /home/gbrown/.mozbuild/android-sdk-linux/emulator/emulator
DEBUG:   ...with creation time Wed Jan 30 21:48:27 2019
DEBUG:   ...with SDK version in /home/gbrown/.mozbuild/android-sdk-linux/emulator/source.properties: Pkg.Revision=28.0.23
 0:00.86 Fetching and installing AVD. This may take a few minutes...
DEBUG: Copied tooltool manifest /home/gbrown/src/testing/config/tooltool-manifests/androidx86_7_0/mach-emulator.manifest to /home/gbrown/.mozbuild/android-device/releng.manifest
DEBUG: INFO - Cache matches, avoiding extracting in 'AVDs-x86-android-7.0-build-2019-04-23'
Error running mach:

    ['android-emulator', '--verbose', '--force-update']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

OSError: [Errno 2] No such file or directory

  File "/home/gbrown/src/mobile/android/mach_commands.py", line 662, in emulator
    emulator.update_avd(force_update)
  File "/home/gbrown/src/testing/mozbase/mozrunner/mozrunner/devices/android_device.py", line 525, in update_avd
    self._update_avd_paths()
  File "/home/gbrown/src/testing/mozbase/mozrunner/mozrunner/devices/android_device.py", line 660, in _update_avd_paths
    os.rename(ini_file, ini_file_new)
gbrown@mozpad2:~/src$ 

Notice:

DEBUG: INFO - Cache matches, avoiding extracting in 'AVDs-x86-android-7.0-build-2019-04-23'

So now a tooltool fetch unpacks an archive and creates <archive>.checksum. With --force-update, android_device.py removes the unpacked directory but leaves the archive and the .checksum, then calls tooltool fetch again; if the manifest is the same, the existing archive is not downloaded (good), but now tooltool skips the unpack based on the checksum.

Deleting <archive>.checksum from android_device.py is tricky because it doesn't know the name of <archive> -- it just knows about the tooltool manifest.

Regressed by: 1533330
Has Regression Range: --- → yes
Keywords: regression

I think a more robust solution would involve disabling the checksum behavior in tooltool.py;
I will leave-open for us to consider later. In the meantime, this will get things working again.

Keywords: leave-open
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b895777154c6
Quick fix for 'mach android-emulator' handling of tooltool checksum file; r=aerickson

Leaving open for improved integration between android_device.py and tooltool.py, but I'm not sure I see a compelling solution right now and don't have time to pursue.

With the quick fix, 'mach android-emulator' should no longer fail this way.

Assignee: gbrown → nobody
Keywords: leave-open
Priority: -- → P3

Good enough. No new trouble.

Assignee: nobody → gbrown
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: