Ask / Submit

FAILED(remote: 'Flashing is not allowed in Lock State')

asked 2019-01-28 17:46:03 +0300

ridmaur gravatar image

updated 2019-01-29 13:04:00 +0300

jiit gravatar image

I am getting this error when trying to flash a new out of the box Sony XA2 device. The service info tells me I am allowed to unlock boot loader and the first step of unlocking using the command

sudo ./ -i 0x0fce oem unlock 0x<IMEI_ID>

seems to work. It doesn't give me an error; only returns

The Sony  Vendor partition image was not found in the current directory. Please
download it from
and unzip it into this directory.

But then I want to flash the phone using

bash ./

This is the output I get

Detected Mac OS X - Version: 10 14 2-
Searching device to flash..
Found 1 devices: CQ3001FB8G 
Fastboot command: fastboot -s CQ3001FB8G  
Flashing boot_a partition..
Sending 'boot_a' (17764 KB)                        OKAY [  0.417s]
Writing 'boot_a'                                   FAILED (remote: 'Flashing is not allowed in Lock State')
Finished. Total time: 0.418s

What am I doing wrong?

edit retag flag offensive close delete


I used Linux for flashing but maybe u forgot to Enable “OEM unlocking” and “USB debugging” from “Settings on ur new XA2 when android is on it before flashing or unlocking BL.? THIS STEP MUST BE DONE! even if u are allowed to unlock according Vendor SONY with ur imei nr.

Maybe its different with MAC

aQUICK1 ( 2019-01-28 18:06:45 +0300 )edit

Upon another forum this has similarly been posted by another Mac user with no feedback as yet:link text. I have always bootloader unlocked Xperia devices upon Windows machine as get "OKAY" acknowledgment in "cmd" window before flashing Sailfish upon Mac. There remains a question mark in both these instances whether device is actually bootloader unlocked or not.

Just a thought upon Mac being a permissions thing don't you need to go to directory cd / in which firmware + blobs placed and carry out:chmod +x ?

aspergerguy ( 2019-01-28 18:22:13 +0300 )edit

I have set OEM unlocking and USB debugging in Android Settings before attempting to flash the device. I will try from a Ubuntu Linux laptop later; see whether that is more successful.

ridmaur ( 2019-01-28 18:51:49 +0300 )edit

No need to to chmod +x as the execution bit is already set on when extracting the zip file.

ridmaur ( 2019-01-28 18:53:24 +0300 )edit

Was device updated to latest Android version prior to attempt to flash Sailfish OS?

aspergerguy ( 2019-01-28 21:41:20 +0300 )edit

3 Answers

Sort by » oldest newest most voted

answered 2019-01-29 07:39:01 +0300

Nieldk gravatar image

The error is quite obvious, and written in the first output. Download the software binaries, unzip them to same folder as Then run oem unlock command. After that, iam pretty sure bootloader will be unlocked (it wasnt in your first attenpt)

edit flag offensive delete publish link more


No, the error is NOT quite obvious. In the first command, I got no error other than the message to download the Sony Android drivers. Only at the second command (when re-flashing the device) I got the error about Lock State. But like said above, I got it to work using a Windows machine following exactly the same procedure. It must be Mac OS X related that I faces the issues.

ridmaur ( 2019-01-29 09:43:01 +0300 )edit

"The Sony Vendor partition image was not found in the current directory. Please download it from and unzip it into this directory."

Nieldk ( 2019-01-29 09:50:29 +0300 )edit

That message does not imply in any way that unlocking is not succesfull. It only indicates that the required image to reflash the phone for Jolla is not available (yet). Also, the instructions clearly indicate that you need to download the partition image and add the .img file to the same directory from where you extracted the fastboot AFTER the unlocking command.

So again, not obvious.

ridmaur ( 2019-01-29 14:47:27 +0300 )edit

answered 2019-01-28 23:18:48 +0300

ridmaur gravatar image

updated 2019-01-29 09:43:23 +0300

Ran installation from Windows and succeeded.

edit flag offensive delete publish link more


Welcome SAILOR!

aQUICK1 ( 2019-01-28 23:59:26 +0300 )edit

Jolla X on XA2 sort of reminds me of my good old Nokia N9

ridmaur ( 2019-01-29 00:39:27 +0300 )edit

answered 2019-01-31 01:11:57 +0300

Andy Branson gravatar image

Glad you managed to flash it in Windows, but for future reference (any anyone else who might end up here with the same problem), the oem unlock command should be run with 'fastboot' not the script, which is only for installing Sailfish after the unlocking process is complete. Also, the code given at the end should be the unlock code given to you by Sony, not your IMEI.

For more details see Step 4 on here:

edit flag offensive delete publish link more


To your second point, I quoted incorrect <IMEI_ID> but I definitely did use the unlock code I got from Sony based on the IMEI. So apologies for not being 100% clear here. To your first point, fastboot.exe is a Windows binary apparently; no way I can execute this on Mac OS X. Trying so returns

-bash: ./fastboot.exe: cannot execute binary file

Hence I used as an alternative.

ridmaur ( 2019-01-31 01:20:01 +0300 )edit

Step 2 points to a 'Platform Tools' download here: which contains packages for Windows, Linux and OSX. runs fastboot to do the flashing, you can see it invoked successfully in your second block in your original post.

Andy Branson ( 2019-01-31 02:32:51 +0300 )edit

You are first telling me that I should run the unlock command using fastboot and now you're saying I should run So what is exactly your point?

I did download the Mac OS X tools, unzipped the file and ran fastboot.exe. That didn't work, so instructions (for Mac OS X) are confusing on Sailfish X pages. Then I looked at and noticed it does some magic to flashboot.exe to make it run.

The main thing I try to point out here is that on Mac OS X the first command, despite not giving an error but only saying you need to download the additional image (see above) does NOT unlock the boot loader. Hence the second command fails.

When fastboot.exe on Windows I got a clear indication about unlocking the boot loader.

So my guess is that there is a problem with the script in how it invokes flashboot.exe and tries to unlock the bootloader on Mac OS X.

ridmaur ( 2019-01-31 09:28:21 +0300 )edit

I'll try to be clearer. does not have anything to do with unlocking the phone. It's only for flashing Sailfish onto it after it has already been unlocked. However to do this, internally it runs the fastboot binary (named only 'fastboot' on Linux or OSX, with no '.exe' extension) which is the same binary that can be used in the earlier unlocking step. In your second piece of output in your original post at the top, you can see that a fastboot command was prepared and executed properly, sending the 'boot' image to the phone which then failed to flash because the phone was still locked. It was fastboot that gave you the OKAY and FAILED errors. This means you did actually have a compatible fastboot binary in place when you ran, and that's what you should have used (not the .exe or for the oem unlock command, in accordance to Sony's instructions.

In the current Android platform tools zip, named ', there's a 'fastboot' in the root directory, with no ',exe' extension, This should work although you don't really need it as you already have one.

Andy Branson ( 2019-01-31 09:58:50 +0300 )edit
Login/Signup to Answer

Question tools



Asked: 2019-01-28 17:46:03 +0300

Seen: 3,444 times

Last updated: Jan 31