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

Core occasionally cannot be downloaded from China #2713

Closed
jpsim opened this issue Oct 20, 2015 · 18 comments
Closed

Core occasionally cannot be downloaded from China #2713

jpsim opened this issue Oct 20, 2015 · 18 comments

Comments

@jpsim
Copy link
Contributor

@jpsim jpsim commented Oct 20, 2015

We've had several reports from users in China who sometimes cannot download Realm's core.

Realm hosts its core binaries in an AWS S3 bucket, available through Cloudflare via our static.realm.io domain. You're affected by this issue if those services are operational, you have a good internet connection, you're in mainland China and you're still getting the following error: Downloading core failed. Please try again once you have an Internet connection..

We're working with Cloudflare to improve our availability in China and will update this issue when we have more to announce.

In the meantime, please use a VPN or a prebuilt version of Realm available through our GitHub releases: https://github.com/realm/realm-cocoa/releases.

Thanks for your patience.

@mrackwitz
Copy link
Contributor

@mrackwitz mrackwitz commented Feb 14, 2016

Please note that through a change to the error handling of CURL in our build.sh script, this errors appears lately with the output as seen below:

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

core is not a symlink. Deleting...
Downloading dependency: core 0.96.1
Downloading core failed:
curl: (56) SSLRead() return error -9806
@mrackwitz
Copy link
Contributor

@mrackwitz mrackwitz commented Feb 22, 2016

Whenever the first download via CocoaPods has failed, the cache could be in a corrupt state. It might help in such cases to remove Realm from the CocoaPods cache, what can be achieved by running the following command:

rm -rf ~/Library/Caches/CocoaPods/Pods/**/Realm*

In addition, the integration in the project should be reset.

rm -rf /Pods

After that and ensuring that you've a working internet connection without restrictions, you can run the following:

pod install --verbose
This was referenced Feb 29, 2016
@madawei2699
Copy link

@madawei2699 madawei2699 commented Apr 4, 2016

I am in china and has the same problem when I use VPN. The core realm package is 63MB, that is so big and the VPN is hard to download it. By looking the build.sh of realm, it use getconf DARWIN_USER_TEMP_DIR1 to get the tmp direction and check the $TMPDIR, if it has the core-${REALM_CORE_VERSION}.tar.bz2. So I download the https://static.realm.io/downloads/core/realm-core-0.97.1.tar.bz2 by VPN and move it to $TMPDIR, then you can pod install.

1.cd `getconf DARWIN_USER_TEMP_DIR`
2.curl https://static.realm.io/downloads/core/realm-core-0.97.1.tar.bz2 -o realm-core-0.97.1.tar.bz2
(use VPN or use the website to help download on onedrive: http://ctrlq.org/save/)
3.cd ~/yourProjectDir/
4.pod install --verbose
@Onetaway
Copy link

@Onetaway Onetaway commented Apr 12, 2016

@madawei2699 says the correct answer. I am also a developer in China.The solution is download realm-core-XXX.tar.bz2 and copy it into /tmp/ dir. So I suggested the maintainer to list the download url of each realm version.

@interchen
Copy link

@interchen interchen commented Jul 29, 2016

Wish you fix this issue ASAP. Too many developer in China work without VPN.

@xilin
Copy link

@xilin xilin commented Aug 1, 2016

@Onetaway You can find the download url in
https://github.com/realm/realm-cocoa/blob/master/build.sh#L289
which is the value of CORE_URL

@zhangxistudy11
Copy link

@zhangxistudy11 zhangxistudy11 commented Aug 8, 2016

It's stop when "Downloading dependency: core 0.100.4".I tried these methods that mentioned above.

@bdash
Copy link
Contributor

@bdash bdash commented Nov 18, 2016

After Realm 2.0.x you'd want to download realm-sync-cocoa-${REALM_SYNC_VERSION}.tar.xz from https://static.realm.io/downloads/sync/realm-sync-cocoa-${REALM_SYNC_VERSION}.tar.xz into ${TMPDIR}/sync_bin, where REALM_SYNC_VERSION can be found at https://github.com/realm/realm-cocoa/blob/master/dependencies.list#L3 (currently 1.0.0-BETA-3.3), and TMPDIR should hopefully already be set in your shell environment (use getconf DARWIN_USER_TEMP_DIR if it's not).

@xingheng
Copy link

@xingheng xingheng commented Nov 22, 2016

This is ridiculous, if the developers from China needs to download the zipped file to local temp directory to let cocoapods to detect it, why not just download the dylib/static framework and add the dependency to project manually directly?

All the pods just pass except the realm-cocoa for command pod install, cocoapods brings the conveniences for developers to manage the 3rd-party packages and easy integration way. If the realm team won't support it, the China developer should switch to manual way w/o any hesitation to use it.

BTW, that would be so nice to write a note/tips in README.md file in github and realm.io/docs, since this issue has blocked so many developers. @realm-admin

BTW, I'm a developer from China. Many thanks for your great job!

@AllenHK
Copy link

@AllenHK AllenHK commented Dec 9, 2016

I have the same problem even I use VPN and I solved it by downloading the dependence manually. In conclusion, you should download realm-core-XXX.tar.xz and realm-sync-cocoa-${REALM_SYNC_VERSION}.tar.xz, then put them into $TMPDIR/core/ and $TMPDIR/sync respectively.

@danat8x8
Copy link

@danat8x8 danat8x8 commented Dec 19, 2016

I am not in China, and I am having lots of trouble installing realm. Here is the relevant bit from the "pod install verbose" output:
-> Installing Realm (2.1.1)

Git download
Git download
$ /usr/local/bin/git clone https://github.com/realm/realm-cocoa.git /var/folders/w4/x6y651ks4zq9jx00gbth2wd5hlmvrr/T/d20161219-5097-12umqi0
--template= --single-branch --depth 1 --branch v2.1.1
Cloning into '/var/folders/w4/x6y651ks4zq9jx00gbth2wd5hlmvrr/T/d20161219-5097-12umqi0'...
Note: checking out 'a6f8e282bdf9d44de635e44b3f8967addbdfd2c9'.

 You are in 'detached HEAD' state. You can look around, make experimental
 changes and commit them, and you can discard any commits you make in this
 state without impacting any branches by performing another checkout.
 
 If you want to create a new branch to retain commits you create, you may
 do so (now or later) by using -b with the checkout command again. Example:
 
   git checkout -b <new-branch-name>
 
 Checking out files: 100% (1101/1101), done.
 $ /usr/local/bin/git -C /var/folders/w4/x6y651ks4zq9jx00gbth2wd5hlmvrr/T/d20161219-5097-12umqi0 submodule update --init --recursive
 Submodule 'Realm/ObjectStore' (https://github.com/realm/realm-object-store.git) registered for path 'Realm/ObjectStore'
 Cloning into '/private/var/folders/w4/x6y651ks4zq9jx00gbth2wd5hlmvrr/T/d20161219-5097-12umqi0/Realm/ObjectStore'...
 Submodule path 'Realm/ObjectStore': checked out 'bedfafd264ffe823a633cac582036ca31be69793'
 Submodule 'external/catch' (https://github.com/philsquared/Catch) registered for path 'Realm/ObjectStore/external/catch'
 Submodule 'external/pegtl' (https://github.com/ColinH/PEGTL) registered for path 'Realm/ObjectStore/external/pegtl'
 Cloning into '/private/var/folders/w4/x6y651ks4zq9jx00gbth2wd5hlmvrr/T/d20161219-5097-12umqi0/Realm/ObjectStore/external/catch'...
 Cloning into '/private/var/folders/w4/x6y651ks4zq9jx00gbth2wd5hlmvrr/T/d20161219-5097-12umqi0/Realm/ObjectStore/external/pegtl'...
 Submodule path 'Realm/ObjectStore/external/catch': checked out 'f294c9847272b1b92c5119a6f711e57113b5f231'
 Submodule path 'Realm/ObjectStore/external/pegtl': checked out '3c4128a7e7e1288eb746418ea60c41477358f26a'

Running prepare command
$ /bin/bash -c set -e sh build.sh cocoapods-setup
[!] /bin/bash -c
set -e
sh build.sh cocoapods-setup

wtf is going on??

@jpsim
Copy link
Contributor Author

@jpsim jpsim commented Dec 19, 2016

@danat8x8 what's wrong with the installation? The log output you shared doesn't seem to indicate a failure of any kind...

If by your own admission your issue is unrelated to what this issue is tracking, why not open a new issue, taking care to fill out the new issue template, and include the full output of pod install --verbose? Thanks!

@danat8x8
Copy link

@danat8x8 danat8x8 commented Dec 19, 2016

apologies, I was typing before thinking. there is an error when it tries to install Realm, that I can't resolve. I'll open another issue.

@ripplek
Copy link

@ripplek ripplek commented Jul 13, 2017

I am in china and has the same problem when I use VPN..Place tell me how to host success

     Submodule path 'Realm/ObjectStore/external/catch': checked out 'ce37f48ffad2401e6c23a54cae3f015c01fdc200'
     Submodule path 'Realm/ObjectStore/external/pegtl': checked out '3c4128a7e7e1288eb746418ea60c41477358f26a'
 > Running prepare command
   $ /bin/bash -c  set -e sh build.sh cocoapods-setup
   core is not a symlink. Deleting...
   Downloading dependency: sync 1.10.0
[!] /bin/bash -c 
set -e
sh build.sh cocoapods-setup

core is not a symlink. Deleting...
Downloading dependency: sync 1.10.0
Downloading sync failed:
	https://static.realm.io/downloads/sync/realm-sync-cocoa-1.10.0.tar.xz
	curl: (28) Operation timed out after 300294 milliseconds with 0 out of 0 bytes received
@yuanjilee
Copy link

@yuanjilee yuanjilee commented Aug 22, 2017

I am facing this problem today, the @madawei2699 is right.
In addition:
for RealmSiwft 2.10.0 source path:
https://static.realm.io/downloads/sync/realm-sync-cocoa-1.10.8.tar.xz
and then pull the file into /tmp/dir, pod install again is OK.

@kimown
Copy link

@kimown kimown commented Sep 28, 2017

The speed almost drives me mad, I don't understand my previous colleague choose this database, but he already leave the company, just because this database can cause a lot of trouble?

@yuanjilee
Copy link

@yuanjilee yuanjilee commented Sep 28, 2017

@kimown
you should download the blew two files:

cocoa:
https://static.realm.io/downloads/sync/realm-sync-cocoa-1.10.8.tar.xz

core:
https://static.realm.io/downloads/core/realm-core-2.8.1.tar.xz

and put them into $TMPDIR/sync & $TMPDIR/core/ separately. So, it can save your a lot of time.

@bdash
Copy link
Contributor

@bdash bdash commented Sep 28, 2017

It's only necessary to download the former file. The latter is not used.

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

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.