Re: [disco-dev] Newbie user mistake and fix for Ubuntu and "src/lager_util.erl:19: can't find include lib "kernel/include/file.hrl"" (need "erlang" package)

219 views
Skip to first unread message

Prashanth Mundkur

unread,
Jan 2, 2013, 3:44:50 PM1/2/13
to disc...@googlegroups.com
On 09:43 Mon 31 Dec, Ian Ozsvald wrote:
> Hi all, I'm just getting my feet wet with Disco. I'm working on Linux Mint
> 13 (Ubuntu 12.04), I ran into an error during setup. Googling showed a
> similar error in some gists but no fix, having figured it out I'll note
> this here in the hope that it helps someone else.
>
> I'm installing from github HEAD. I've never used erlang before.
>
> First I checked out the dev branch:
> http://discoproject.org/doc/disco/start/download.html#development-branches
> and made sure that I had the "erlang-base" package installed (as "escript"
> is required), but then:
> ----
> git clone git://github.com/discoproject/disco.git
> cd DISCO_HOME
> DISCO_HOME $ make
> ==> lager (get-deps)
> ==> mochiweb (get-deps)
> ==> master (get-deps)
> ==> lager (compile)
> src/lager_util.erl:19: can't find include lib "kernel/include/file.hrl"
> src/lager_util.erl:64: record file_info undefined
> src/lager_util.erl:65: record file_info undefined
> src/lager_util.erl:76: record file_info undefined
> src/lager_util.erl:79: record file_info undefined
> make: *** [master] Error 1
> ----
>
> The fix is to also install the "erlang" package in Ubuntu.
>
> Might it be worth listing the "erlang" package as a dependency requirement
> on the Install page? "erlang" wants either "erlang-base" or
> "erlang-base-hipe", I'm not sure which (if either) is better.

We just list Erlang itself as a dependency, to be distribution-agnostic.
http://discoproject.org/doc/disco/start/install.html#prerequisites
But yes, it might be worthwhile to have specific instructions for
Debian/Ubuntu.

> I'm curious to know if there's a difference between "erlang-base" and
> "erlang-base-hipe" (I'm using the non-hipe version). Should one be
> favoured over the other? The only notes I found were that the "hipe"
> branch code was folded into the main erlang project years ago (but that
> doesn't tell me why I might want to avoid the hipe version).

The 'hipe' version uses the native-code compiler. We don't use hipe
because the native-code code is not as portable as byte-code. Afaik,
code compiled with hipe needs to run against exactly the same version
of the run-time as that it was compiled with. So you will need
exactly the same version of Erlang on your build machine as your
cluster. Erlang byte-code has looser versioning requirements, which
is easier to support in a cluster environment with a separate build
machine. That said, it is possible that native-code compatibility has
improved in the recent versions of Erlang.

> Before fixing the problem I also tried using the "Latest Release" link:
> http://discoproject.org/doc/disco/start/download.html#latest-release
> but the linked page is empty:
> https://github.com/discoproject/disco/downloads
> and if you download the Tagged release 0.4.4 release via the Tag button on
> the right then during the compile phase you get:
> ----
> fatal: Not a git repository (or any parent up to mount parent /home)
> Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
> make: *** [master] Error 1
> ----

Yes, unfortunately this is a limitation of the Erlang build tool that
we are using (rebar). We can look into using a patched version of
rebar to get around this.

> I also tried the Debian Package
> http://discoproject.org/doc/disco/start/download.html#debian-packages
> but it seemed to want Python 2.6 only, not 2.7 (I don't have 2.6 on Ubuntu
> 12.04).

I'm not a Debian packaging expert, but handling python versions
according to Debian Policy is IMHO totally fubar, and Python3 is
making it even worse. That's why the source-tree contains the
'make-discoproject-debian' script to help you build debian packages
that are compatible with your own debian/ubuntu environments.
Unfortunately, this option is not present in our current
documentation; I will add it.

> I guess I missed something in the install flow but it felt a bit trickier
> to download+compile than I expected. Perhaps other first-timers will trip
> up on the download page too?
>
> Personally I prefer building locally as I can play with virtualenvs
> (rather than having a global install via apt-get), so for me the easy fix
> would be to see a requirement for the "erlang" package (with a note on
> hipe or not-hipe) on the download page.
>
> I'm compiled now so I'll move on to testing my setup.

Thanks for your experience report and feedback, and good luck! :)

--
prashanth

Ian Ozsvald

unread,
Jan 31, 2013, 9:39:06 AM1/31/13
to disc...@googlegroups.com
Hi all. I've had a few teething troubles, now fixed. In case they're useful to others these points aren't clear on the install guide:

If your DISCO_HOME is different between the main server and the slaves, a 'ps' on the slaves will show processes starting/ending with an error (which I couldn't glean anything from) and your main log will show errors on the slave. Make sure Disco is installed the same way on each machine - I had the slaves DISCO_HOME directory in a different path to the master. This is a problem of my own making - I've not used 'sudo make install' on my machines and I'm running it from local directories.

Also related, if you get a .erlang.cookie read error like:
{error_logger,{{2013,1,31},{13,19,57}},"Error when reading /home/ian/.erlang.cookie: eacces",[]}
then it'll be due to ownership. My erlang was owned by 'root' but I was user 'ian', I did a 'sudo chown ian .erlang.cookie' and the process could then start (I was running bin/disco as user 'ian'). Permissions for the cookie are 400.

Hoping nobody else gets bitten by these,
Ian.



On Monday, 31 December 2012 17:43:27 UTC, Ian Ozsvald wrote:
Hi all, I'm just getting my feet wet with Disco. I'm working on Linux Mint 13 (Ubuntu 12.04), I ran into an error during setup. Googling showed a similar error in some gists but no fix, having figured it out I'll note this here in the hope that it helps someone else.

I'm installing from github HEAD. I've never used erlang before.

First I checked out the dev branch:
http://discoproject.org/doc/disco/start/download.html#development-branches
and made sure that I had the "erlang-base" package installed (as "escript" is required), but then:
----
git clone git://github.com/discoproject/disco.git
cd DISCO_HOME
DISCO_HOME $ make
==> lager (get-deps)
==> mochiweb (get-deps)
==> master (get-deps)
==> lager (compile)
src/lager_util.erl:19: can't find include lib "kernel/include/file.hrl"
src/lager_util.erl:64: record file_info undefined
src/lager_util.erl:65: record file_info undefined
src/lager_util.erl:76: record file_info undefined
src/lager_util.erl:79: record file_info undefined
make: *** [master] Error 1
----

The fix is to also install the "erlang" package in Ubuntu.

Might it be worth listing the "erlang" package as a dependency requirement on the Install page? "erlang" wants either "erlang-base" or "erlang-base-hipe", I'm not sure which (if either) is better.

I'm curious to know if there's a difference between "erlang-base" and "erlang-base-hipe" (I'm using the non-hipe version). Should one be favoured over the other? The only notes I found were that the "hipe" branch code was folded into the main erlang project years ago (but that doesn't tell me why I might want to avoid the hipe version).

Before fixing the problem I also tried using the "Latest Release" link:
http://discoproject.org/doc/disco/start/download.html#latest-release
but the linked page is empty:
https://github.com/discoproject/disco/downloads
and if you download the Tagged release 0.4.4 release via the Tag button on the right then during the compile phase you get:
----
fatal: Not a git repository (or any parent up to mount parent /home)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
make: *** [master] Error 1
----

I also tried the Debian Package
http://discoproject.org/doc/disco/start/download.html#debian-packages
but it seemed to want Python 2.6 only, not 2.7 (I don't have 2.6 on Ubuntu 12.04).

I guess I missed something in the install flow but it felt a bit trickier to download+compile than I expected. Perhaps other first-timers will trip up on the download page too?

Personally I prefer building locally as I can play with virtualenvs (rather than having a global install via apt-get), so for me the easy fix would be to see a requirement for the "erlang" package (with a note on hipe or not-hipe) on the download page.

I'm compiled now so I'll move on to testing my setup.

Cheers,
Ian.

Prashanth Mundkur

unread,
May 26, 2013, 12:45:58 PM5/26/13
to disc...@googlegroups.com
On 02:30 Thu 09 May, crsc...@crschmidt.net wrote:

> so, assuming that you want to download a release (as an archive of
> some sort, rather than cloning via git), what is the way to do this?
> The "Official Releases" page:
> https://github.com/discoproject/disco/downloads
>m
> shows no downloads?
>
> If the answer is "Clone from a release tag", then that should
> probably be explicitly stated on
> http://discoproject.org/doc/disco/start/download.html...

Thanks for pointing this out, I've updated the docs. Note that since
the 0.4.5 release, the preferred location for the docs is
http://disco.readthedocs.org/en/latest/

--prashanth
Reply all
Reply to author
Forward
0 new messages