installing zotonic on Freebsd jail

41 views
Skip to first unread message

Java House

unread,
Nov 24, 2019, 12:52:47 PM11/24/19
to Zotonic developers
Hello

I am attempting to install zotonic for first time. but it does not seem to start properly.
Can anyone help please?

Here is my current setup

$ uname -a
FreeBSD jail-erlang 12.1-RELEASE FreeBSD 12.1-RELEASE r354233 GENERIC  amd64

$ erl
Erlang/OTP 21 [erts-10.3.5.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]

$ gcc --version
gcc (FreeBSD Ports Collection) 9.2.0

$ g++ --version
g++ (FreeBSD Ports Collection) 9.2.0

$ git --version
git version 2.23.0

$ gettext --version
gettext (GNU gettext-runtime) 0.20.1

$ convert -version
Version: ImageMagick 7.0.8-57 Q16 amd64 2019-11-21 https://imagemagick.org

$ psql -V
psql (PostgreSQL) 12rc1


then followed the instructions from here http://docs.zotonic.com/en/latest/developer-guide/getting-started.html to build and start zotonic
but  I am getting 
curl: (7) Failed to connect to localhost port 8443: Connection refused

Here is the build and run setup.

$ cd zotonic
$ gmake
$ bin/zotonic debug
$ bin/zotonic debug
Erlang/OTP 21 [erts-10.3.5.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]

Eshell V10.3.5.5  (abort with ^G)
(zotonic001@jail-erlang)1> ** /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/qdate_localtime/ebin/ibuild.beam hides /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/erlang_localtime/ebin/ibuild.beam
** /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/qdate_localtime/ebin/localtime_dst.beam hides /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/erlang_localtime/ebin/localtime_dst.beam
** /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/qdate_localtime/ebin/localtime.beam hides /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/erlang_localtime/ebin/localtime.beam
** Found 3 name clashes in code paths 
=CRASH REPORT==== 24-Nov-2019::18:36:41.307341 ===
  crasher:
    initial call: lager_handler_watcher:init/1
    pid: <0.169.0>
    registered_name: []
    exception exit: noproc
      in function  gen:do_for_proc/2 (gen.erl, line 228)
      in call from gen_event:rpc/2 (gen_event.erl, line 239)
      in call from lager_handler_watcher:install_handler2/3 (src/lager_handler_watcher.erl, line 117)
      in call from lager_handler_watcher:init/1 (src/lager_handler_watcher.erl, line 51)
      in call from gen_server:init_it/2 (gen_server.erl, line 374)
      in call from gen_server:init_it/6 (gen_server.erl, line 342)
    ancestors: [lager_handler_watcher_sup,lager_sup,<0.154.0>]
    message_queue_len: 0
    messages: []
    links: [<0.157.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 610
    stack_size: 27
    reductions: 226
  neighbours:

=INFO REPORT==== 24-Nov-2019::18:36:41.452012 ===
Setup running ...

=INFO REPORT==== 24-Nov-2019::18:36:41.453207 ===
Directories verified. Res = ok

=INFO REPORT==== 24-Nov-2019::18:36:41.453371 ===
Setup finished processing hooks (Mode=normal)...

=INFO REPORT==== 24-Nov-2019::18:36:41.478962 ===
    msg: Starting reporters with []

    options: []
** /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/qdate_localtime/ebin/ibuild.beam hides /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/erlang_localtime/ebin/ibuild.beam
** /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/qdate_localtime/ebin/localtime_dst.beam hides /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/erlang_localtime/ebin/localtime_dst.beam
** /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/qdate_localtime/ebin/localtime.beam hides /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/erlang_localtime/ebin/localtime.beam
** Found 3 name clashes in code paths 
=INFO REPORT==== 24-Nov-2019::18:36:41.680407 ===
filezcache: repopulating cache with 0 keys
=INFO REPORT==== 24-Nov-2019::18:36:41.680495 ===
filezcache: scanning cache directory for unknown files.
** /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/qdate_localtime/ebin/ibuild.beam hides /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/erlang_localtime/ebin/ibuild.beam
** /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/qdate_localtime/ebin/localtime_dst.beam hides /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/erlang_localtime/ebin/localtime_dst.beam
** /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/qdate_localtime/ebin/localtime.beam hides /usr/home/nikolas/Downloads/zotonic-0.52.0/deps/erlang_localtime/ebin/localtime.beam
** Found 3 name clashes in code paths 
18:36:41.803 [info] emqtt_app:35 starting emqtt on node 'zotonic001@jail-erlang'
18:36:41.818 [info] emqtt_auth:55 emqtt_auth is started
18:36:41.820 [info] emqtt_retained:89 emqtt_retained is started.
18:36:41.821 [info] emqtt_router:121 emqtt_router is started.
18:36:41.824 [info] emqtt_registry:56 emqtt_registry is started.
18:36:41.826 [info] emqtt_client_monitor:46 emqtt_client_monitor is started.
18:36:41.835 [info] emqtt_app:38 emqtt broker is running now.
=INFO REPORT==== 24-Nov-2019::18:36:41.888410 ===
gen_smtp_server starting at 'zotonic001@jail-erlang'

=INFO REPORT==== 24-Nov-2019::18:36:41.890088 ===
gen_smtp_server listening on {127,0,0,1}:2525 via tcp

18:36:41.932 [info] z_sites_manager:276 Site started: zotonic_status (<0.325.0>)
18:36:41.951 [error] z_filewatcher_sup:58 FILEWATCHER: please install fswatch or inotify-tools to automatically load changed files
=SUPERVISOR REPORT==== 24-Nov-2019::18:36:42.045104 ===
    supervisor: {local,zotonic_sup}
    errorContext: start_error
    reason: eprotonosupport
    offender: [{pid,undefined},
               {id,webmachine_mochiweb_v6},
               {mfargs,
                   {webmachine_mochiweb,start,
                       [webmachine_mochiweb_v6,
                        [{port,8000},
                         {ip,any6},
                         {dispatcher,z_sites_dispatcher},
                         {dispatch_list,[]},
                         {backlog,500},
                         {acceptor_pool_size,75}]]}},
               {restart_type,permanent},
               {shutdown,5000},
               {child_type,worker}]
=CRASH REPORT==== 24-Nov-2019::18:36:42.045270 ===
  crasher:
    initial call: mochiweb_socket_server:init/1
    pid: <0.508.0>
    registered_name: []
    exception exit: eprotonosupport
      in function  gen_server:init_it/6 (gen_server.erl, line 358)
    ancestors: [zotonic_sup,<0.292.0>]
    message_queue_len: 0
    messages: []
    links: [<0.305.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 376
    stack_size: 27
    reductions: 842
  neighbours:

Terminating due to shutdown
=CRASH REPORT==== 24-Nov-2019::18:36:42.046068 ===
  crasher:
    initial call: application_master:init/4
    pid: <0.291.0>
    registered_name: []
    exception exit: {{shutdown,
                         {failed_to_start_child,webmachine_mochiweb_v6,
                             eprotonosupport}},
                     {zotonic_app,start,[normal,[]]}}
      in function  application_master:init/4 (application_master.erl, line 138)
    ancestors: [<0.290.0>]
    message_queue_len: 1
    messages: [{'EXIT',<0.292.0>,normal}]
    links: [<0.290.0>,<0.43.0>]
    dictionary: []
    trap_exit: true
    status: running
    heap_size: 1598
    stack_size: 27
    reductions: 358
  neighbours:

=INFO REPORT==== 24-Nov-2019::18:36:42.046417 ===
    application: zotonic
    exited: {{shutdown,
                 {failed_to_start_child,webmachine_mochiweb_v6,
                     eprotonosupport}},
             {zotonic_app,start,[normal,[]]}}
    type: temporary
18:36:42.046 [error] zotonic:66 Zotonic start error: {{shutdown,{failed_to_start_child,webmachine_mochiweb_v6,eprotonosupport}},
 {zotonic_app,start,[normal,[]]}}
=SUPERVISOR REPORT==== 24-Nov-2019::18:36:42.331520 ===
    supervisor: {local,gr_counter_sup}
    errorContext: child_terminated
    reason: killed
    offender: [{pid,<0.171.0>},
               {id,gr_lager_default_tracer_counters},
               {mfargs,{gr_counter,start_link,
                                   [gr_lager_default_tracer_counters]}},
               {restart_type,transient},
               {shutdown,brutal_kill},
               {child_type,worker}]
=SUPERVISOR REPORT==== 24-Nov-2019::18:36:42.331558 ===
    supervisor: {local,gr_param_sup}
    errorContext: child_terminated
    reason: killed
    offender: [{pid,<0.170.0>},
               {id,gr_lager_default_tracer_params},
               {mfargs,{gr_param,start_link,[gr_lager_default_tracer_params]}},
               {restart_type,transient},
               {shutdown,brutal_kill},
               {child_type,worker}]

Kind Regards
Nikolas

Marc Worrell

unread,
Nov 25, 2019, 4:44:11 AM11/25/19
to 'Marc Worrell' via Zotonic developers
Hi,

Looks like the ipv6 listener can’t start.
=SUPERVISOR REPORT==== 24-Nov-2019::18:36:42.045104 === supervisor: {local,zotonic_sup} errorContext: start_error reason: eprotonosupport offender: [{pid,undefined}, {id,webmachine_mochiweb_v6}, {mfargs, {webmachine_mochiweb,start, [webmachine_mochiweb_v6, [{port,8000}, {ip,any6}, {dispatcher,z_sites_dispatcher}, {dispatch_list,[]}, {backlog,500}, {acceptor_pool_size,75}]]}}, {restart_type,permanent}, {shutdown,5000},
{child_type,worker}]
We check if ipv6 is available and if it is we start the listener.
This is in zotonic_sup.erl:

ipv6_supported() ->
    case (catch inet:getaddr("localhost", inet6)) of
        {ok, _Addr} -> true;
        {error, _} -> false
    end.

Apparently the system pretend there is ip6 but doesn’t really support it.

You can disable starting the ipv6 listener by providing a specific listener port instead of ‘any’ in the zotonic.config

Replace this

%%% IP address on which Zotonic will listen for HTTP requests.
%%% Always overridden by the ZOTONIC_IP environment variable.
%%% Use 'any' for all IP addresses.
   {listen_ip, any},

With this:

%%% IP address on which Zotonic will listen for HTTP requests.
%%% Always overridden by the ZOTONIC_IP environment variable.
%%% Use 'any' for all IP addresses.
   {listen_ip, {0,0,0,0}},

If this fixes the problem then we can look into a better ipv6 detection method.
One of the methods I am thinking of is by actually opening the port before proceeding.

Cheers, Marc

Java House

unread,
Nov 25, 2019, 2:03:37 PM11/25/19
to Zotonic developers
Hi Marc

where do I find the zotonic.config file?
I searched and there is nowhere bellow the zotonic directory.
I found only one copy under docker/zotonic.config but the file has different content and I am not using docker.

Best
Nikolas

Marc Worrell

unread,
Nov 25, 2019, 5:27:27 PM11/25/19
to 'Marc Worrell' via Zotonic developers
Hi Nikolas,

Try:

~/.zotonic/0/zotonic.config

It should have been installed there by the bin/zotonic script.

Cheers, Marc


--

---
You received this message because you are subscribed to the Google Groups "Zotonic developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotonic-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotonic-developers/ca77a00c-03aa-4047-a95c-1252dda57db4%40googlegroups.com.

Java House

unread,
Nov 25, 2019, 6:11:09 PM11/25/19
to Zotonic developers
Thank you Marc, 
I found the file and changed the listen_ip and dbhost but I cannot connect using https
Is there some additional step required?

* Rebuilt URL to: https://10.2.3.14:8443/
*   Trying 10.2.3.14...
* TCP_NODELAY set
* Connected to 10.2.3.14 (10.2.3.14) port 8443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
* TLSv1.3 (IN), TLS alert, handshake failure (552):
* error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure
* Closing connection 0
curl: (35) error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure




%%% PostgreSQL database defaults.
%%% These are the defaults for the equally named options in your site's config file.
   {dbdatabase, "zotonic"},
   {dbschema, "public"},
   {dbpassword, []},
   {dbuser, "zotonic"},
   {dbport, 5432},
   {dbhost, {10,2,4,11}},

%%% By default, Zotonic will create a postgres database for you if it doesn't
%%% already exist, and install tables in it. Uncomment the options below
%%% to prevent that.
 % {dbcreate, false},
 % {dbinstall, false},

%%% IP address on which Zotonic will listen for HTTP requests.
%%% Always overridden by the ZOTONIC_IP environment variable.
%%% Use 'any' for all IP addresses.
   {listen_ip, {10,2,3,14}},
To unsubscribe from this group and stop receiving emails from it, send an email to zotonic-developers+unsub...@googlegroups.com.

Marc Worrell

unread,
Nov 27, 2019, 6:39:10 AM11/27/19
to 'Marc Worrell' via Zotonic developers
Hi,

Do you also see some messages on the Erlang command line?

Did you try to connect with http to :8000 and see if there is a redirect to https :8443?
If so then Zotonic is listening and responding.

If there are errors on the erlang command line and you are on OTP21, then you might need to get a patched OTP install.
I just saw someone referring to TLS handshake errors on OTP 21.3.
That problem was fixed in 21.3.8.5

Cheers, Marc



To unsubscribe from this group and stop receiving emails from it, send an email to zotonic-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/zotonic-developers/f80ada51-3b9d-48db-8017-e54f6f9c29a8%40googlegroups.com.

Java House

unread,
Nov 27, 2019, 4:21:54 PM11/27/19
to Zotonic developers
HI Marc

thank you for your patience.

http on port 8000 is indeed working, no redirect though to https.
I get the Powered by zotonic message.
https on port 8443 gives following error on browser

Secure Connection Failed
An error occurred during a connection to 10.2.3.14:8443. Cannot communicate securely with peer: no common encryption algorithm(s). Error code: SSL_ERROR_NO_CYPHER_OVERLAP 

on the erlang console I see the following
=INFO REPORT==== 27-Nov-2019::21:33:18.797164 ===
TLS server: In state hello at tls_handshake.erl:134 generated SERVER ALERT: Fatal - Handshake Failure - malformed_handshake_data


from the console I got
> erlang:system_info(otp_release). 
"21"


I also found a pdf version of the instructions for 0.52 release


Best
Niikolas
Reply all
Reply to author
Forward
0 new messages