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

Hanging on 'Downloading library build "*" (might take a while)' #968

Open
arvoelke opened this issue Apr 6, 2020 · 5 comments · May be fixed by #969
Open

Hanging on 'Downloading library build "*" (might take a while)' #968

arvoelke opened this issue Apr 6, 2020 · 5 comments · May be fixed by #969

Comments

@arvoelke
Copy link

arvoelke commented Apr 6, 2020

On the current master branch of mbed-cli:

mbed new simple_test --mbedlib 
[mbed] Working path "/home/arvoelke/git/..." (program)
[mbed] Creating new program "simple_test" (git)
[mbed] Adding library "mbed" from "https://mbed.org/users/mbed_official/code/mbed/builds" at branch/tag "tip"
[mbed] Downloading library build "65be27845400" (might take a while)

I've tried this three times now, each time keeping it open for more than 24 hours -- and it still hangs.

If I visit the above url (https://mbed.org/users/mbed_official/code/mbed/builds) and click on the first build (65be27845400), it takes me to an invalid page:

https://os.mbed.com/users/mbed_official/code/mbed//builds/65be27845400/

An error occurred while processing your request
no such method: builds

Note there are two slashes (//) in the URL. If I remove one of the slashes then the link becomes valid. Is there a fix or work-around? Thanks.

arvoelke added a commit to arvoelke/mbed-cli that referenced this issue Apr 6, 2020
@arvoelke arvoelke linked a pull request Apr 6, 2020 that will close this issue
@arvoelke
Copy link
Author

arvoelke commented Apr 6, 2020

Did some checking around:

mbed-cli/mbed/mbed.py

Lines 393 to 400 in c2528f6

action("Downloading library build \"%s\" (might take a while)" % rev)
inurl = urlopen(url)
with open(rev_file, 'wb') as outfd:
data = None
while data != '':
# Download and write the data in 1 MB chunks
data = inurl.read(1024 * 1024)
outfd.write(data)
and noticed that the empty string check is an infinite loop in Python3 (since b'' != '').
Fixed in #969.

@ciarmcom
Copy link
Member

ciarmcom commented Apr 7, 2020

Internal Jira reference: https://jira.arm.com/browse/IOTBTOOL-648

@TheMcSebi
Copy link

TheMcSebi commented Dec 3, 2022

For everyone still encountering this issue after 2022:

pip uninstall mbed-cli
git clone https://github.com/ARMmbed/mbed-cli.git
cd mbed-cli
pip install --editable .

edit mbed/mbed.py and change line 397 to:

while data != b'':

and line 294 to:

return stdout.decode("ANSI")

then you should be able to download the libraries

@Maaajaaa
Copy link

return stdout.decode("ANSI")

led to this error on my machine (Ubuntu 22.04):

ERROR: Unknown Error: unknown encoding: ANSI

so I changed it back to the original, then it worked successfully.

@DhariMT
Copy link

DhariMT commented Feb 18, 2024

For everyone still encountering this issue after 2022:

pip uninstall mbed-cli
git clone https://github.com/ARMmbed/mbed-cli.git
cd mbed-cli
pip install --editable .

edit mbed/mbed.py and change line 397 to:

while data != b'':

and line 294 to:

return stdout.decode("ANSI")

then you should be able to download the libraries

This worked but without editing line 294 on Ubuntu (editing the line gave another error when creating the project). Thanks a lot, I have been going crazy over this

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

Successfully merging a pull request may close this issue.

5 participants