papakay

papakay

Hello, please i’m having issue deploying to a digitalocean droplet (Ubuntu 16.04.3).

Please find below the error details:

Output of the command is shown above and the command executed
on that host is printed below for debugging purposes:

FAILED with exit status 255:

    current_shell="$0" || :
    [ -z "$current_shell" ] && current_shell="$SHELL"
    case "$current_shell" in
      (*bash*) echo 'bash is installed and the default shell'  ;;
      (*zsh*)  echo  'zsh is installed and the default shell'  ;;
      (*)
       echo
       echo "You are using an unsupported shell: '$current_shell'"
       echo "edeliver requires either bash or zsh to be installed"
       echo "and the default shell for the build user 'kehinde'"
       echo "on your build host: '46.101.30.23'."
       exit 1
       ;;
    esac
    set -e
    if [ ! -d /home/kehinde/app_name/builds ]
    then
      mkdir -p /home/kehinde/app_name/builds
      cd /home/kehinde/app_name/builds
      git init
      git config receive.denyCurrentBranch ignore
    else
      cd /home/kehinde/app_name/builds
      git config receive.denyCurrentBranch ignore
    fi

Showing Posts 24 to 15

joaquinalcerro

joaquinalcerro

So I am following this thread to solve the same issue without success. I will appreciate your help in this matter.

Environment

Elixir 1.6.6 (compiled with OTP 20)
edeliver v1.4.5 | GitHub - edeliver/edeliver: Deployment for Elixir and Erlang · GitHub
distillery 1.5.3
OpenSuse Leap 15 (my laptop) with name: linux-6h0b
Build Server: Ubuntu 16.04
Production Server: Ubuntu 16.04

The problem

BUILDING RELEASE OF EPR APP ON BUILD HOST

-----> Authorizing hosts
-----> Ensuring hosts are ready to accept git pushes
ssh: connect to host linux-6h0b port 22: Connection refused

A remote command failed on:

  jalcerro@linux-6h0b

Output of the command is shown above and the command executed
on that host is printed below for debugging purposes:

FAILED with exit status 255:

    current_shell="$0" || :
    [ -z "$current_shell" ] && current_shell="$SHELL"
    case "$current_shell" in
      (*bash*) echo 'bash is installed and the default shell' &> /dev/null ;;
      (*zsh*)  echo  'zsh is installed and the default shell' &> /dev/null ;;
      (*)
       echo
       echo "You are using an unsupported shell: '$current_shell'"
       echo "edeliver requires either bash or zsh to be installed"
       echo "and the default shell for the build user 'jalcerro'"
       echo "on your build host: 'linux-6h0b'."
       exit 1
       ;;
    esac
    set -e
    if [ ! -d /home/jalcerro/app_build ]
    then
      mkdir -p /home/jalcerro/app_build
      cd /home/jalcerro/app_build
      git init &> /dev/null
      git config receive.denyCurrentBranch ignore
    else
      cd /home/jalcerro/app_build
      git config receive.denyCurrentBranch ignore
    fi

My .deliver/config file

#!/usr/bin/env zsh

APP="epr"

BUILD_HOST="build-server.local"
BUILD_USER="jalcerro"
BUILD_AT="/home/jalcerro/app_build"

PRODUCTION_HOSTS="prod-app.local"
PRODUCTION_USER="support" 
DELIVER_TO="/home/support/epr" 

pre_erlang_get_and_update_deps() {
  local _prod_secret_path="/home/jalcerro/app_config/prod.secret.exs"
  if [ "$TARGET_MIX_ENV" = "prod" ]; then
    __sync_remote "
      ln -sfn '$_prod_secret_path' '$BUILD_AT/config/prod.secret.exs'
    "
  fi
}

I have configured

  • I am able to ssh into my build server without password
  • Configured .ssh/config file proppery
  • Used ssh-copy-id to add key to authorized-keys file
  • check my shell to by zsh in passwd

I don’t understand

  • Why is edeliver trying to use my computer name “linux-6h0b” instead of the the build_host “build-server.local”?

Thanks for your help.

papakay

papakay OP

Thanks immensely for this great information.

OvermindDL1

OvermindDL1

Yep, you always want to run the build on either the production setup or on something that is absolutely identical. The production VM for this is idle enough that I just build it straight on it.

papakay

papakay OP

Thanks so much. I guess you run this script on the production server?

OvermindDL1

OvermindDL1

Mine is just:

#!/bin/sh

export MIX_ENV=prod
export PORT=3080
cd assets
npm install
./node_modules/.bin/brunch build --production
cd ..
mix deps.get
mix phx.digest
mix release "${@}"

I just git pull, run that script, run a test or two then swap to the new version via system-ctl (which I could put in script too, and probably should since I always run the same commands anyway…).

You could easily push those over SSH as well, that’d be fairly trivial.

papakay

papakay OP

That would have been great but I don’t have a sound knowledge of how to achieve that. Please do you have any script you could share?

Thanks immensely @OvermindDL1

OvermindDL1

OvermindDL1

Huh, that’s buggy…

Why not just use your own script with distillary instead of using edeliver? :slight_smile:

papakay

papakay OP

I found the issue to be a port issue. Please refer to this link

https://github.com/edeliver/edeliver/issues/230#issuecomment-382800734

papakay

papakay OP

Thanks for this information. I really appreciate!

alexandrubagu

alexandrubagu

I use Docker for building because I don’t have same verion of OS on production. Here’s my Docker file:

FROM elixir:1.4

RUN \
  apt-get update && \
  apt-get install -y wget curl

RUN \
  apt-get update && \
  curl -sL https://deb.nodesource.com/setup_6.x | bash - && \
  apt-get install -y nodejs

RUN \
  apt-get update && \
  apt-get install -y build-essential openssh-server htop git

RUN mkdir /var/run/sshd

# SSH login fix. Otherwise user is kicked off after login
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

RUN useradd --system --shell=/bin/bash --create-home builder
COPY ssh_key.pub /home/builder/.ssh/authorized_keys
COPY ssh_key.pub /home/root/.ssh/authorized_keys

RUN mix local.hex
RUN mix local.rebar

CMD ["/usr/sbin/sshd", "-D"]
EXPOSE 22

As you can see I create user like this:
useradd --system --shell=/bin/bash --create-home builder

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews