Fl4m3Ph03n1x

Fl4m3Ph03n1x

Cannot find libtinfo.so.6 when launching elixir app

Background

I am using elixir 1.9 with erlang 22.0 and I am using the command mix release. However when I try to run my app with _build/dev/rel/andy/bin/my_app start start I get an error:

Error

This is the error I get when trying to run it:

/home/devops/_build/dev/rel/my_app/erts-10.4.3/bin/beam.smp: error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory

To fix it I tried running sudo apt-get install libtinfo.so.6 but it doesn’t look like it exists:


Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libtinfo.so.6
E: Couldn't find any package by glob 'libtinfo.so.6'
E: Couldn't find any package by regex 'libtinfo.so.6'

This is my OS operation:

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.6 LTS
Release:	16.04
Codename:	xenial

How can I fix this?

Marked As Solved

NobbZ

NobbZ

You probably build your release on a different setup, one which had libtinfo.so.6 available.

Please build the release on an Ubuntu 16.04.6 and nothing else.


edit

$ curl "https://packages.ubuntu.com/xenial/allpackages?format=txt.gz" | zgrep libtinfo
libtinfo-dev (6.0+20160213-1ubuntu1) developer's library for the low-level terminfo library
libtinfo5 (6.0+20160213-1ubuntu1) shared low-level terminfo library for terminal handling
libtinfo5-dbg (6.0+20160213-1ubuntu1) debugging/profiling library for the low-level terminfo library

For 16.04 only libtinfo5 is available as it seems.

It contains the following files (https://packages.ubuntu.com/xenial/amd64/libtinfo5/filelist):

  • /lib/x86_64-linux-gnu/libtinfo.so.5
  • /lib/x86_64-linux-gnu/libtinfo.so.5.9
  • /usr/lib/x86_64-linux-gnu/libtic.so.5
  • /usr/lib/x86_64-linux-gnu/libtic.so.5.9
  • /usr/share/doc/libtinfo5/TODO.Debian
  • /usr/share/doc/libtinfo5/changelog.Debian.gz
  • /usr/share/doc/libtinfo5/copyright

Also Liked

Manzanit0

Manzanit0

Just for the record, I came across this yesterday, same issue, etc. and this is the final working Dockerfile I came up with, in case anybody finds it useful.

FROM elixir:1.10.3 AS app_builder

ENV MIX_ENV=prod \
    LANG=C.UTF-8

# Build local package repository
RUN mix local.hex --force && \
    mix local.rebar --force

RUN mkdir /app
WORKDIR /app

# Compile dependencies
COPY mix.exs .
COPY mix.lock .
RUN mix deps.get && mix deps.compile

# Let's make sure we have node
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
    apt-get install -y nodejs

# Compile assets
COPY assets ./assets
RUN npm install --prefix ./assets && \
    npm run deploy --prefix ./assets

# Now, let's go with the actual elixir code. The order matters: if we only
# change elixir code, all the above layers will be cached ~ less image build time.
COPY config ./config
COPY lib ./lib
COPY priv ./priv

# Final build step: digest static assets and generate the release
RUN mix phx.digest && mix release

FROM debian:buster-slim AS app

ENV LANG=C.UTF-8

RUN apt-get update && apt-get install -y openssl

RUN useradd --create-home app
WORKDIR /home/app
COPY --from=app_builder /app/_build .
RUN chown -R app: ./prod
USER app

CMD ["./prod/rel/cookbook/bin/cookbook", "start"]
NobbZ

NobbZ

Please also add deps to your .dockerignoe. Some packages create artifacts in there :frowning:

Also, I can’t see where you define base, but you reference it. Just from looking at it, this wont actually work.

Where Next?

Popular in Questions Top

Tee
can someone please explain to me how Enum.reduce works with maps
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
Kagamiiiii
Student & New to elixir. Nice language. I want to convert a english character, e.g. “a”, which is stored in a variable, to it’s asci...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
kostonstyle
Hi all I want to have a unix time, from the current time plus 1 hour. DateTime.now + 1 hour How to get it in elixir? Thanks
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New

Other popular topics Top

JakeBecker
TL;DR: I’ve just released an implementation of Microsoft’s IDE-independent Language Server Protocol for Elixir. It adds language support ...
1140 51847 244
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New

We're in Beta

About us Mission Statement