Realm-cocoa: Download core 0.96.0 failed when update realm from 0.97.0 to 0.98.0

Created on 6 Feb 2016  路  14Comments  路  Source: realm/realm-cocoa

Realm can not update properly, when I run pod update --verbose.

console prints

[!] /bin/bash -c 
set -e
sh build.sh cocoapods-setup

core is not a symlink. Deleting...
Downloading dependency: core 0.96.0
Downloading core failed:
curl: (56) SSLRead() return error -9806

I tried to download core via http://static.realm.io/downloads/core/realm-core-0.96.0.tar.bz

Chrome says

404 Not Found

Code: NoSuchKey
Message: The specified key does not exist.
Key: downloads/core/realm-core-0.96.0.tar.bz
RequestId: B8067B66AED8ABE8
HostId: QwFCFYrlp7iDvUlewILgPliNGIyN7krFqgDNHbHMBiX3Yooa0CL9IiwUQbMDu63G1xtCLARmKv0=
An Error Occurred While Attempting to Retrieve a Custom Error Document

Code: NoSuchKey
Message: The specified key does not exist.
Key: 404.html
T-Help

Most helpful comment

@Yoncise those steps should not be necessary, since if your browser can download core, so should curl.

In any case, the manual steps you refer to are these:

curl https://static.realm.io/downloads/core/realm-core-0.96.0.tar.bz2 -O
mkdir $TMPDIR/core_bin
mv realm-core-0.96.0.tar.bz2 $TMPDIR/core_bin

Then Realm's build.sh script should pick up that file, even if you're offline when you install Realm.

All 14 comments

@Yoncise the URL you provided is incorrect. build.sh cocoapods-setup should be downloading core from http://static.realm.io/downloads/core/realm-core-0.96.0.tar.bz2 (note the '2' at the end). Are you perhaps located in China? If so, please see #2713.

Sorry for that I missed 2. I can download core from browser correctly now.
It's hard to tell whether pods is downloading core correctly even I added --verbose.
As @MickeyHub suggested in #2446,

Beacause of bad net env.
the prepare command Realm provide is sh build.sh cocoapod-setup, mainly code is download realm-core, download realm-core if $TMPDIR/core_bin/core-${REALM_CORE_VERSION}.tar.bz2 file not exists. so if you downloads always failed, you can download realm-core directly according to url provided by build.sh (shell script function download_core), and then backup it, when you need pod install realm, you can mv it to $TMPDIR/core_bin/core-${REALM_CORE_VERSION}.tar.bz2.

${REALM_CORE_VERSION} is core version , such as 0.92.1.1

I don't understand the text which I add bold style in the above quote.

So I will appreciated it if you tell me how to upgrade realm when I have downloaded realm-core-0.96.0.tar.bz2 from browser or other download tools. In other words, if I use pod update to update realm, how can I skip the process of downloading core when I have downloaded core.

It might help to install CURL via brew. Can you give that a try? Forget what I said, that's something else.

@Yoncise those steps should not be necessary, since if your browser can download core, so should curl.

In any case, the manual steps you refer to are these:

curl https://static.realm.io/downloads/core/realm-core-0.96.0.tar.bz2 -O
mkdir $TMPDIR/core_bin
mv realm-core-0.96.0.tar.bz2 $TMPDIR/core_bin

Then Realm's build.sh script should pick up that file, even if you're offline when you install Realm.

Ok, got it. Thanks!

I have set up a proxy for my browser to pass GFW (Great Firewall of China) so I can download core from browser. Unfortunately, it seems that my proxy doesn't work for my terminal... Damn GFW.

Thanks again.

the same issue that i meet now,do you have solved it ?@Yoncise

  1. You should download core via url first. I have uploaded it to BaiduYun for your convenience.
  2. Execute below commands

    mkdir $TMPDIR/core_bin
    mv realm-core-0.96.1.tar.bz2 $TMPDIR/core_bin/core-0.96.1.tar.bz2
    
  3. Now Realm will update as normal, when you run pod update --verbose

@jpsim
From build.sh

CORE_TAR="${TMP_DIR}/core-${REALM_CORE_VERSION}.tar.bz2"

mv realm-core-0.96.1.tar.bz2 $TMPDIR/core_bin should be changed to mv realm-core-0.96.1.tar.bz2 $TMPDIR/core_bin/core-0.96.1.tar.bz2 to let build.sh pick up downloaded core.

ps. The latest version is 0.96.1, you should change version code accordingly.

@jpsim
I find it that I can download core via http without any proxies, however, I can not update realm via pods which uses https protocol. curl echo error curl: (35) Server aborted the SSL handshake or something else about SSL continuously. It's weird.

Great,it saves me lots of time.Damn GFW

@Yoncise Hi, I used the v0.96 core to update my cocoaPods, but now when I try to update Realm to the latest version (which I think is v0.98.4), I failed again. Could you tell me where to find the URL to download the core? Many thanks!

@chaiyixiao
From realm-cocoa/build.sh file, you can see this statement

: ${REALM_CORE_VERSION:=0.97.0} # set to "current" to always use the current build
local CORE_URL="https://static.realm.io/downloads/core/realm-core-${REALM_CORE_VERSION}.tar.bz2"

Note, you need use core version (which is 0.97.0 now) instead of realm version (which is 0.98.4 now), so, the download url of v0.98.4's core is https://static.realm.io/downloads/core/realm-core-0.97.0.tar.bz2

@Yoncise Just noticed that I missed the CORE_VERSION. Thanks a lot!!聽馃榿

@chaiyixiao Here is the core download url : http://static.realm.io/downloads/core/realm-core-0.96.2.tar.bz2 of Realm version 0.98.3, just change the core version in the url when it updates.Suppose the current core version(not Realm pod version) is 0.97.0, just replace the 0.96.2 with 0.97.0.For more information,dive into realm-cocoa/build.sh

Thanks for the solution. For the bad network in China I have to do it all the time.

Was this page helpful?
0 / 5 - 0 ratings