Cannot hg clone mbed

23 Oct 2017

I cannot hg clone the mbed (2) library from os.mbed.com. As shown below, it creates the mbed/.hg/ folder with several small files in it, then just sits for several minutes until it times out. (Then it deletes the files and destination directory it had created.)

[EDIT: mbed import doesn't work on it, either. Added log below.]

I've successfully cloned other repos from the site, so I think this is a sever-side issue. What is the issue? Please fix it and report back. Let me know if you need any addtional info.

(The log below was taken using cygwin on Windows 7, but I got the same result with TortoiseHg, except that TortoiseHg added [command returned code 255 Mon Oct 23 13:19:50 2017] following the HTTP 504.)

me@mypc /cygdrive/c/dev/external
$ hg clone --verbose https://bmcdonnell_ionx@os.mbed.com/users/mbed_official/code/mbed/ mbed__hg
requesting all changes
HTTP Error: 504 (Gateway Time-out)

Directory listing taken in another window, while the clone operation was stuck:

me@mypc /cygdrive/c/dev/external/mbed__hg
$ ls -alFR
.:
total 8
drwxrwxr-x+ 1 me Domain Users 0 Oct 23 13:30 ./
drwxrwxr-x+ 1 me Domain Users 0 Oct 23 13:30 ../
drwxrwxr-x+ 1 me Domain Users 0 Oct 23 13:30 .hg/

./.hg:
total 11
drwxrwxr-x+ 1 me             Domain Users  0 Oct 23 13:30 ./
drwxrwxr-x+ 1 me             Domain Users  0 Oct 23 13:30 ../
-rw-rw-r--+ 1 me             Domain Users 57 Oct 23 13:30 00changelog.i
-rw-rw-r--+ 1 me             Domain Users 40 Oct 23 13:30 dirstate
-rw-rw-r--+ 1 me             Domain Users  0 Oct 23 13:30 journal.bookmarks
-rw-rw-r--+ 1 me             Domain Users  7 Oct 23 13:30 journal.branch
-rw-rw-r--+ 1 me             Domain Users 74 Oct 23 13:30 journal.desc
-rw-rw-r--+ 1 me             Domain Users 40 Oct 23 13:30 journal.dirstate
-rw-rw-r--+ 1 me             Domain Users 46 Oct 23 13:30 requires
drwxrwxr-x+ 1 me             Domain Users  0 Oct 23 13:30 store/
-rwxrwxr-x+ 1 Administrators Domain Users  0 Oct 23 13:30 thgstatus*
lrwxrwxrwx  1 me             Domain Users 12 Oct 23 13:30 wlock -> mypc:10704

./.hg/store:
total 5
drwxrwxr-x+ 1 me Domain Users  0 Oct 23 13:30 ./
drwxrwxr-x+ 1 me Domain Users  0 Oct 23 13:30 ../
-rw-rw-r--+ 1 me Domain Users  0 Oct 23 13:30 journal
-rw-rw-r--+ 1 me Domain Users  0 Oct 23 13:30 journal.backupfiles
-rw-rw-r--+ 1 me Domain Users  0 Oct 23 13:30 journal.phaseroots
lrwxrwxrwx  1 me Domain Users 12 Oct 23 13:30 lock -> mypc:10704

mbed-cli failing to import:

me@mypc /cygdrive/c/dev/external
$ mbed import https://os.mbed.com/users/mbed_official/code/mbed/
abort: HTTP Error 504: Gateway Time-out
fatal: Invalid path '/cygdrive/c/dev/external/C:\dev\external\mbed': No such file or directory
[mbed] Importing program "mbed" from "https://os.mbed.com/users/mbed_official/code/mbed" at latest revision in the current branch
[mbed] ERROR: Unable to clone repository (https://os.mbed.com/users/mbed_official/code/mbed/)
---
23 Oct 2017

Hi, Thank you for reporting, we are able to reproduce the clone/import issue with mbedCLI. However, the online compiler is able to import and function normally. We are working with our web team to resolve this issue. Please use the online compiler in the meantime to continue working with the Hg repos.

24 Oct 2017

I was not able to replicate. I am using Windows 10, just cmd.exe. However, it took 5 minutes and the size of the clone is 1 GB. This is way too large and needs to be brought to attention.

24 Oct 2017

Senthil Rangaswamy wrote:

Hi, Thank you for reporting, we are able to reproduce the clone/import issue with mbedCLI. However, the online compiler is able to import and function normally. We are working with our web team to resolve this issue. Please use the online compiler in the meantime to continue working with the Hg repos.

I am able to clone this hg repo on a hi-speed connection. The repo size seems to be the culprit, causing intermittent failures depending on network link quality. We are raising this issue with repo maintainers to find a resolution.

31 Oct 2017

Any progress on this?

Senthil Rangaswamy wrote:

Please use the online compiler in the meantime to continue working with the Hg repos.

That has failure points, too. I can't compare revisions from the repository history.

I tried selecting the radio buttons for two revisions, and clicking the "Compare" button. The failure is pictured below.

Please advise.

/media/uploads/bmcdonnell_ionx/2017-10-31__mbed_online_cannot_compare.png

31 Oct 2017

Senthil, since you were able to clone the repo, can you please zip that up (with the .hg subdir) and post it here, so I can download it? That way at least I can browse the history and do compares locally while this fix is pending.

21 Nov 2017

Brendan, as mentioned in the PM, the repo size is large and there are file size restrictions in terms of making the entire repo available as a zip file. I have raised the issue with our Tools team and we are currently looking into solution(s). Stay tuned.

Unfortunately, the only solution I can think of in the meantime is to clone using mbedCLI from a fast connection. Sorry for the delayed response, I missed your post somehow.

21 Nov 2017

Senthil Rangaswamy wrote:

Unfortunately, the only solution I can think of in the meantime is to clone using mbedCLI from a fast connection. Sorry for the delayed response, I missed your post somehow.

I just did a speedtest on my connection. I have > 30 Mbps down, > 26 Mbps up, and 7 ms ping. This is my home connection today; results are the same from work, where it gives up after downloading a handful of files, only *tens* of bytes each, to the .hg directory.

I don't think there's any problem on my end.

Quote:

the repo size is large and there are file size restrictions in terms of making the entire repo available as a zip file.

I've PMed you a link to a share that you can upload it to for me, please.

Quote:

I have raised the issue with our Tools team and we are currently looking into solution(s). Stay tuned.

I look forward to it. Meanwhile, it's been weeks since you raised the issue, so I'm trying to work-around it.

I've had several reasons along the way to want to look at the mbed repo history. At the moment I'm trying to understand how the filesystem software architecture has changed since about rev 121 or so, all the way up through the current mbed-os. That rev is (approximately, IIRC) the last when it was compatible with Embedded Artists' test program for the LPC4088QSB with EBB.

28 Nov 2017

Senthil,

The issue is not resolved, but I was finally able to work around it by pulling progressively as described here: Mercurial repo too large, can't connect, clone.

I had to grab the changesets in groups of 10 or so at a time, though - not hundreds or more, as in the link. Here is a list of the commands that succeeded for me.

hg clone --verbose -r 4c0c40fd059 https://username@os.mbed.com/users/ 
cd mbed
hg pull -r 40
hg pull -r 60
hg pull -r 80
hg pull -r 90
hg pull -r 100
hg pull -r 110
hg pull -r 120
hg pull -r 130
hg pull -r 140
hg pull -r 150
hg pull
hg update

This seems to be a known issue with Mercurial, but I think usually in repositories with thousands of revisions, not < 200. Maybe the mbed 2 has unusually large changesets.

I'll reply to your PM here...

Senthil Rangaswamy wrote:

Are you still unable to clone this repo using mbed CLI?

I still cannot clone it in one step. There has been no change in that since my initial post.

Quote:

Have you by any chance tried this on a broadband connection?

As described in my previous reply, I've tried from two. My 30 Mbps connection qualifies as "broadband", per the FCC (2015 guideline, 25 Mbps down, 3 Mbps up).

Quote:

The issue is that the size of this repo is 1GB (with history) and it takes a while to download depending on the internet bandwidth. You may experience timeout on slow a connection.

I strongly doubt it has anything at all to do with the speed or reliability of my connections. I gave details about one of my connections in my previous post.

The fact that the --uncompressed option didn't work suggests that an unreliable connection isn't the issue here - at least on my end. (Working with Mercurial over Unreliable Connections)

28 Nov 2017

Brendan,

We have an issue with the mbed 2 library right now, it is too large to clone down. We are internally working on a fix. In the mean time the mbed-dev library (https://os.mbed.com/users/mbed_official/code/mbed-dev/) can be used instead. Please try swapping out your mbed.lib with mbed-drv.lib and let me know how it goes.

All the best,

-Austin

29 Nov 2017

Austin,

Thanks. This makes things a bit more confusing, though, and prompts several questions.

Now I'm aware of three mbed repositories:

When you say "mbed-src", do you mean the first one above?

Aside from the bad clone behavior of the one, what is the relationship between them? And what are the relationships between mbed 2 and mbed OS 5 with each of them?

The Github location is mbed OS 5 now, right? And it's the current "canonical" location for it, right?

Did Github ever have mbed 2 code? Or has it always been mbed OS 5?

Is mbed-src only mbed 2, or does it become mbed OS 5 at some point? What about mbed-dev?

Do the "rev" numbers in the Github tags and commit messages correspond to the "revs" named in mbed-dev log messages? Do they also correspond to the hg short revs in mbed-src?

When did mbed OS 5 begin, in terms of rev numbers and repository histories? What is the cutoff from the "rev" numbers between mbed 2 and mbed OS 5?

30 Nov 2017

Brendan,

yeah, its a bit confusing, sorry.

theres some history here, let me walk you through it.

Mbed 2 - 2012-2016 - simple SDK with peripheral API's (UART, SPI, I2C...etc)
- mbed.lib - pre-compiled mbed 2 libarary. Precompiled for speed saving in the online compiler. This is why it can compile in <10 seconds each time. Upside: fast compiles. Downside: no source code browsing
- mbed-src (now mbed-dev) - full source for mbed 2 sdk. Upside : full source browsing. Downside : slow as hell to compile.
- source was on github.com/mbedmicro/mbed, this was released onto the repos on developer.mbed.org because the compiler at the time could only import mercurial repos, it didnt support github repos.

Mbed 5 - 2016 + - extended functionality of mbed 2, added connectivity (BLE, Thread, Wifi, Cellular...etc) and RTOS functionality (Threads and Event Que). mbed 5 is a super set of mbed 2 and serves to consolidate what were formerly seperate libraries (ble.lib, rtos.lib, mbed.lib,...etc) under a single repository and form a product better suited for IoT. mbed 5 is an evolution of mbed 2, and still maintains all the mbed 2 APIs in the peripheral section.
- mbed-os.lib - lives on github at github.com/armmbed/mbed-os. It should be notes that this has now superceeded the old mbed 2 repo.
- mbed 2 is now released as a special instance of mbed 5. There is no more separate mbed 2 source code on github, but the mercurial repos on mbed.org are updated with what is effectively a sub-release of mbed-os

Future - eventually we will clean up this story, there is a bunch of work ongoing to make this easier to understand. I cannot comment on it too much publically as such.

Also, im sure there is a github revision where mbed-os overtook the mbed 2 work, but I dont know which one it is, that history is really really long. It happened some time in early 2017.