[diy-sharown.rhcloud.com diy]\> mix deps.get
Registry update failed (http_error)
{:failed_connect, [{:to_address, {'s3.amazonaws.com', 443}}, {:inet, [:inet], :eacces}]}
** (Mix) Failed to fetch registry
#!/bin/bash
# The logic to start up your application should be put in this
# script. The application will work only if it binds toDEPS_DIR=${OPENSHIFT_HOMEDIR}app-root/dependencies/export PATH=$PATH:${DEPS_DIR}erl/usr/lib/erlang/bin:${DEPS_DIR}elixir/binexport MIX_HOME=${DEPS_DIR}mix_home
mkdir MIX_HOMEexport HEX_HOME=${DEPS_DIR}hex_home
mkdir HEX_HOMEexport HOST=$OPENSHIFT_DIY_IP
export PORT=$OPENSHIFT_DIY_PORT# Install Erlang if neededif ! which erl; then
cd $DEPS_DIR
wget http://packages.erlang-solutions.com/site/esl/esl-erlang/FLAVOUR_1_general/esl-erlang_17.4-1~centos~6_amd64.rpm -O /tmp/erlang.rpm
mkdir erl
cd erl
rpm2cpio /tmp/erlang.rpm | cpio -idmv
fi
cp -f $OPENSHIFT_REPO_DIR/install/* ${DEPS_DIR}erl/usr/lib/erlang/bin/# install Elixir if neededif ! which iex; then
wget https://github.com/elixir-lang/elixir/releases/download/v1.0.2/Precompiled.zip -O /tmp/elixir.zip
cd $DEPS_DIR
mkdir elixir
cd elixir
unzip /tmp/elixir.zip
fi
mix local.hex --forcecd $OPENSHIFT_REPO_DIR
elixir --versioncd diy
mix deps.get
mix deps.compile
nohup ./runAsProd.sh |& /usr/bin/logshifter -tag diy &
I don’t know what the eaccess
error means in the context of inet / httpc
. It’s usually some kind of permission error, anyone knowledgable about OTP that knows?
Can you try to hit https://s3.amazonaws.com/s3.hex.pm/registry.ets.gz from the machine in the same context you’re running your script to see if that works? Maybe just add wget https://s3.amazonaws.com/s3.hex.pm/registry.ets.gz
to your script and check if that command is able to fetch the registry.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
elixir -e "IO.puts System.tmp_dir"
$ strace -o trace.txt -f -v mix deps.get
$ grep EACCES --color -C5 trace.txt
457820 setsockopt(7, SOL_SOCKET, SO_PRIORITY, [0], 4) = 0457820 write(4, "!", 1) = 1457819 <... poll resumed> ) = 1 ([{fd=3, revents=POLLIN|POLLRDNORM}])457820 bind(7, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16 <unfinished ...>457819 read(3, <unfinished ...>457820 <... bind resumed> ) = -1 EACCES (Permission denied)457819 <... read resumed> "!", 32) = 1457820 futex(0x7f8d63fea428, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>457819 read(3, 0x7f8d5bc3ea60, 32) = -1 EAGAIN (Resource temporarily unavailable)457819 futex(0x7f8d63fea428, FUTEX_WAKE_PRIVATE, 1 <unfinished ...>457820 <... futex resumed> ) = 0--457819 clock_gettime(CLOCK_MONOTONIC, {113128, 430242609}) = 0457819 read(8, "\0\0\0b\0\0\0\1\4\0\0\0\0016\347@\230\0\0\0\4s3-1.amazon"..., 65536) = 102457819 socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 9457819 fcntl(9, F_GETFL) = 0x2 (flags O_RDWR)457819 fcntl(9, F_SETFL, O_RDWR|O_NONBLOCK) = 0457819 bind(9, {sa_family=AF_INET, sin_port=htons(0), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 EACCES (Permission denied)457819 close(9) = 0457819 futex(0x7f8d63740350, FUTEX_WAKE_PRIVATE, 1) = 1457815 <... futex resumed> ) = 0457819 poll([{fd=3, events=POLLIN|POLLRDNORM}, {fd=0, events=POLLIN|POLLRDNORM}, {fd=8, events=POLLIN|POLLRDNORM}], 3, 0 <unfinished ...>457815 stat("/var/lib/openshift/5492b7595973cad763000203/app-root/runtime/dependencies/elixir/bin/../lib/mix/ebin/httpc_response.beam", <unfinished ...>
Interactive Elixir (1.0.2) - press Ctrl+C to exit (type h() ENTER for help)iex(1)> :inets.start:ok
iex(3)> :httpc.request(:get, {'http://www.erlang.org', []}, [timeout: 10000], []){:error, {:failed_connect, [{:to_address, {'www.erlang.org', 80}}, {:inet, [:inet], :eacces}]}}
iex(4)> {:ok, ip }=:inet.parse_address('127.2.103.129'){:ok, {127, 2, 103, 129}}
iex(5)> :httpc.set_options([ip: ip]):ok
iex(7)> :httpc.request(:get, {'http://www.erlang.org', []}, [timeout: 10000], []){:error, {:failed_connect, [{:to_address, {'www.erlang.org', 80}}, {:inet, [:inet, {:ip, {127, 2, 103, 129}}], :timeout}]}}
[diy-sharown.rhcloud.com 5492b7595973cad763000203]\> curl -s http://www.telize.com/ip54.211.71.173
iex(1)> :inets.start:ok
iex(2)> {:ok, ip }=:inet.parse_address('54.211.71.173'){:ok, {54, 211, 71, 173}}
iex(3)> :httpc.request(:get, {'http://www.erlang.org', []}, [timeout: 10000], []){:error, {:failed_connect, [{:to_address, {'www.erlang.org', 80}}, {:inet, [:inet], :eacces}]}}