Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: type object 'req' has no attribute 'version' . Error in the first step itself #508

Open
gstjee opened this issue Feb 25, 2024 · 13 comments

Comments

@gstjee
Copy link

gstjee commented Feb 25, 2024

It seems there is some issue in python code itself(exception handling or anything else) of edl file.

Error:
.......
main - Mode detected: sahara
Traceback (most recent call last):
File "C:\Users\GuruHP\edl\edl", line 386, in
base.run()
File "C:\Users\GuruHP\edl\edl", line 294, in run
version = conninfo["data"].version
AttributeError: type object 'req' has no attribute 'version'

Tried with and without loader & also with serial port or zadig driver , but still same error coming.

Device is Motorola Edge 30 (Dubai)

@Llixuma
Copy link

Llixuma commented Feb 27, 2024

same here, if i restart EDL mode it gets stuck on "Trying to read first storage sector"

@LukeShortCloud
Copy link

I'm getting the same errors on Fedora (SELinux is set to permissive) when using any edl command. For example, trying to backup the boot image:

$ edl --loader=xbl_s_devprg_ns.melf --memory=ufs r init_boot_a ~/init_boot_a.img
Keystone library is missing (optional).
Qualcomm Sahara / Firehose Client V3.62 (c) B.Kerler 2018-2023.
main - Using loader xbl_s_devprg_ns.melf ...
main - Waiting for the device
main - Device detected :)
main - Mode detected: sahara
Traceback (most recent call last):
  File "/usr/bin/edl", line 386, in <module>
    base.run()
  File "/usr/bin/edl", line 294, in run
    version = conninfo["data"].version
              ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'req' has no attribute 'version'

I tried this hack to get around the error but the edl command seems to hang (which could be another issue).

$ sudo vim /usr/bin/edl
        if not "data" in conninfo:
            version = 2
        else:
            #version = conninfo["data"].version
            version = 2

@bkerler do you have any suggestions on how we can work around this?

@dzid26
Copy link

dzid26 commented Mar 7, 2024

I was getting that after loading the wrong loader. It would only clear after reconnecting USB and choosing correct loader.

@LukeShortCloud
Copy link

Unplugging and plugging in the USB cable did the trick for me, too!

On a related note, it sounds like there should be some error reporting added. For example:

        if not "data" in conninfo:
            version = 2
        else:
            try:
                version = conninfo["data"].version
            except:
                print("ERROR: Unable to find a suitable EDL connection. Try switching the device to EDL mode with 'adb reboot edl' and replugging in the USB cable.")

@bernardovalente
Copy link

I'm getting the same error as discribed but unplugging/plugging did not solve the issue. @dzid26 how do you choose from different loaders?

@dzid26
Copy link

dzid26 commented Mar 12, 2024

I'm getting the same error as discribed but unplugging/plugging did not solve the issue. @dzid26 how do you choose from different loaders?

Normally I use default loader which shows up when you start edl:

 .\edl getstorageinfo
Qualcomm Sahara / Firehose Client V3.62 (c) B.Kerler 2018-2023.
main - Trying with no loader given ...
main - Waiting for the device
.main - Device detected :)
sahara - Protocol version: 2, Version supported: 1
main - Mode detected: sahara
sahara - 
Version 0x2
------------------------
HWID:              0x0002123100000000 (MSM_ID:0x0008e0e1,OEM_ID:0x0000,MODEL_ID:0x0000)
CPU detected:      "SDA845"
PK_HASH:           0xafca69d4235117e5bfc21467068b20df85e0115d7413d5821883a6d244961581
Serial:            0x75f3acff

sahara - Possibly unfused device detected, so any loader should be fine...
sahara - Trying loader: C:\Apps\edl\edlclient\..\Loaders\qualcomm\factory\sdm845_sdm850_sda845\0008e0e100000000_afca69d4235117e5_fhprg.bin
sahara - Protocol version: 2, Version supported: 1
sahara - Uploading loader C:\Apps\edl\edlclient\..\Loaders\qualcomm\factory\sdm845_sdm850_sda845\0008e0e100000000_afca69d4235117e5_fhprg.bin ...
sahara - 64-Bit mode detected.
sahara - Firehose mode detected, uploading...
sahara - Loader successfully uploaded.
main - Trying to connect to firehose loader ...

If you want to change the loader use --loader="path_to_laoder". It has to be right type of loader for your device. Sometimes there are few options.
After each unsuccessful try reconnect usb.

@bernardovalente
Copy link

Issue resolved, had to reinstall the drivers and used the latest edl version. Thank you

@filipe-maia
Copy link

filipe-maia commented Apr 1, 2024

I have a Xiaomi Redmi Note 6 Pro and I was also having this problem on Linux.

I tried editing the edl file with @LukeShortCloud's suggestions to see if I could reach further, but no.
Anyway, I do think that the last suggestion by @LukeShortCloud should be added to master.

I then decided to try on Windows 10, and still I was getting this error.

I then tried on Windows 10 to install Zadig's libusb-win32 drivers and everything started to work.

@filipe-maia
Copy link

I also tried Zadig's libusbK, this driver seems to work as well as libusb-win32.

@ElectroBoy404NotFound
Copy link

I have a Xiaomi Redmi Note 6 Pro and I was also having this problem on Linux.

I tried editing the edl file with @LukeShortCloud's suggestions to see if I could reach further, but no. Anyway, I do think that the last suggestion by @LukeShortCloud should be added to master.

I then decided to try on Windows 10, and still I was getting this error.

I then tried on Windows 10 to install Zadig's libusb-win32 drivers and everything started to work.

Hmm maybe some permission problem in linux?

@cuynu
Copy link

cuynu commented May 8, 2024

still no solution?? this does work on my lg sdm845/sm8150 but doesn't work on redmagic 9 pro or other devices with the same chip, it throw the same error as above

@ElectroBoy404NotFound
Copy link

ElectroBoy404NotFound commented May 8, 2024

still no solution?? this does work on my lg sdm845/sm8150 but doesn't work on redmagic 9 pro or other devices with the same chip, it throw the same error as above

I think you need a firehose file made specifically for your device.

@cuynu
Copy link

cuynu commented May 8, 2024

still no solution?? this does work on my lg sdm845/sm8150 but doesn't work on redmagic 9 pro or other devices with the same chip, it throw the same error as above

I think you need a firehose file made specifically for your device.

yes, i used specific firehose which is works with QFIL on windows but not on bkerler/edl, it just throw error like this issue and doesnt even detect device info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants