Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{failed_to_start_child,gateway_config_worker,{'EXIT',{{badmatch,{error,no_access}},[{gateway_config #83

Open
CamelShoko opened this issue Dec 7, 2021 · 7 comments

Comments

@CamelShoko
Copy link

CamelShoko commented Dec 7, 2021

=====
===== LOGGING STARTED Tue Dec  7 10:54:41 GMT 2021
=====
Exec: /usr/lib/erlang/erts-11.1.8/bin/erlexec -boot /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/start -mode embedded -boot_var SYSTEM_LIB_DIR /usr/lib/erlang/lib -config /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/sys.config -args_file /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/vm.args -- console  --relx-disable-hooks
Root: /home/pi/gateway-config/_build/prod/rel/gateway_config
/home/pi/gateway-config/_build/prod/rel/gateway_config
Erlang/OTP 23 [erts-11.1.8] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]

{"Kernel pid terminated",application_controller,"{application_start_failure,gateway_config,{{shutdown,{failed_to_start_child,gateway_config_worker,{'EXIT',{{badmatch,{error,no_access}},[{gateway_config_worker,start_link,1,[{file,\"/home/pi/gateway-config/src/gateway_config_worker.erl\"},{line,53}]},{supervisor,do_start_child_i,3,[{file,\"supervisor.erl\"},{line,385}]},{supervisor,do_start_child,2,[{file,\"supervisor.erl\"},{line,371}]},{supervisor,'-start_children/2-fun-0-',3,[{file,\"supervisor.erl\"},{line,355}]},{supervisor,children_map,4,[{file,\"supervisor.erl\"},{line,1171}]},{supervisor,init_children,2,[{file,\"supervisor.erl\"},{line,321}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,417}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,385}]}]}}}},{gateway_config_app,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,gateway_config,{{shutdown,{failed_to_start_child,gateway_config_worker,{'EXIT',{{badmatch,{error,no_access}},[{gateway_config

Crash dump is being written to: erl_crash.dump...done
@CamelShoko
Copy link
Author

does this program 'gateway-config' run's in miner docker ?
i run it on raspberry but cause this error logs

@CamelShoko
Copy link
Author

maybe i need modify ./config/sys.config file, but now i have no idea.

%% -*- erlang -*-
[
 {kernel, [
   %% force distributed erlang to only run on localhost
           {inet_dist_use_interface, {127,0,0,1}}
          ]},
 {sasl, [
         {sasl_error_logger, false}
        ]},

 {lager, [
          {error_logger_redirect, true},
          {suppress_supervisor_start_stop, true},
          {log_root, "/var/log/gateway_config"},
          {crash_log, "crash.log"},
          {colored, true},
          {handlers, [
                      {lager_file_backend, [{file, "console.log"}, {level, info}]},
                      {lager_file_backend, [{file, "error.log"}, {level, error}]}
                     ]}
         ]},

 {gateway_config,
  [
   {keys_file, "/var/data/public_keys"},
   {lights_off, "/tmp/gateway_lights_off"},
   {button, [
             {gpio, 7}
            ]}
  ]}
].

@CamelShoko
Copy link
Author

need i change this config 'inet_dist_use_interface'?

@CamelShoko
Copy link
Author

CamelShoko commented Dec 7, 2021

wow, i do not do this
cp -R _build/prod/rel/gateway_config/config/com.helium.Config.conf /etc/dbus-1/system.d/

as the miner have a conf for dbus-1 already,
cp -R com.helium.Miner.conf /etc/dbus-1/system.d/

so, i need copy the tow files or change the gateway-config's in gateway_config.hrl file
-define(CONFIG_APPLICATION_NAME, "com.helium.Config").
to
-define(CONFIG_APPLICATION_NAME, "com.helium.Miner").

@CamelShoko
Copy link
Author

i have do this:
$ cp -R _build/prod/rel/gateway_config/config/com.helium.Config.conf /etc/dbus-1/system.d/

but with nrf connect on mobile can not found the device.

the log file

Eshell V11.1.8  (abort with ^G)
(gateway_config@127.0.0.1)1>
=====
===== LOGGING STARTED Wed Dec  8 01:32:26 GMT 2021
=====
Exec: /usr/lib/erlang/erts-11.1.8/bin/erlexec -boot /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/start -mode embedded -boot_var SYSTEM_LIB_DIR /usr/lib/erlang/lib -config /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/sys.config -args_file /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/vm.args -- console  --relx-disable-hooks
Root: /home/pi/gateway-config/_build/prod/rel/gateway_config
/home/pi/gateway-config/_build/prod/rel/gateway_config
Protocol 'inet_tcp': the name gateway_config@127.0.0.1 seems to be in use by another Erlang node

=====
===== LOGGING STARTED Wed Dec  8 01:33:07 GMT 2021
=====
Exec: /usr/lib/erlang/erts-11.1.8/bin/erlexec -boot /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/start -mode embedded -boot_var SYSTEM_LIB_DIR /usr/lib/erlang/lib -config /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/sys.config -args_file /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/vm.args -- console  --relx-disable-hooks
Root: /home/pi/gateway-config/_build/prod/rel/gateway_config
/home/pi/gateway-config/_build/prod/rel/gateway_config
Protocol 'inet_tcp': the name gateway_config@127.0.0.1 seems to be in use by another Erlang node
Erlang/OTP 23 [erts-11.1.8] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]

@CamelShoko
Copy link
Author

more info

here is a '-name miner@127.0.0.1 '

pi@raspberrypi:~ $ ps -aux | grep config
root        1005 44.2  6.8 1223428 130044 ?      Sl   05:48   0:29 /opt/miner/bin/miner -Bd -c true -C multi_time_warp -- -root /opt/miner -progname opt/miner/bin/miner -- -home /root -- -noshell -noinput -boot /opt/miner/releases/2021.11.21.2/start -mode embedded -boot_var SYSTEM_LIB_DIR /opt/miner/lib -config /opt/miner/releases/2021.11.21.2/sys.config -name miner@127.0.0.1 -setcookie miner -- -- foreground --
pi          1227  1.5  1.8  61220 35736 ?        S    05:48   0:01 /usr/bin/python3 /usr/share/system-config-printer/applet.py
pi          2257  0.0  0.0   6044   664 pts/0    S+   05:49   0:00 grep --color=auto config
pi@raspberrypi:~ $

@CamelShoko
Copy link
Author

the ps info

pi@raspberrypi:/etc/dbus-1/system.d $ ps -aux | grep "setcookie"
root         989 31.3  5.1 1183568 96856 ?       Sl   08:21  23:56 /opt/miner/bin/miner -Bd -c true -C multi_time_warp -- -root /opt/miner -progname opt/miner/bin/miner -- -home /root -- -noshell -noinput -boot /opt/miner/releases/2021.11.21.2/start -mode embedded -boot_var SYSTEM_LIB_DIR /opt/miner/lib -config /opt/miner/releases/2021.11.21.2/sys.config -name miner@127.0.0.1 -setcookie miner -- -- foreground --
root        5984  0.3  2.2 2521600 42708 pts/1   Ssl+ 09:01   0:08 /home/pi/gateway-config/_build/prod/rel/gateway_config/bin/gateway_config -- -root /home/pi/gateway-config/_build/prod/rel/gateway_config -progname home/pi/gateway-config/_build/prod/rel/gateway_config/bin/gateway_config -- -home /root -- -boot /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/start -mode embedded -boot_var SYSTEM_LIB_DIR /usr/lib/erlang/lib -config /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/sys.config -name gateway_config@127.0.0.1 -setcookie gateway_config -- -- console  --relx-disable-hooks --
pi          8963  0.0  0.0   6044   668 pts/2    S+   09:37   0:00 grep --color=auto setcookie

the '/etc/dbus-1/system.d' files

pi@raspberrypi:/etc/dbus-1/system.d $ ls -la
total 56
drwxr-xr-x 2 root root 4096 Dec  8 01:23 .
drwxr-xr-x 4 root root 4096 Oct 30 13:30 ..
-rw-r--r-- 1 root root 1144 Feb  6  2021 avahi-dbus.conf
-rw-r--r-- 1 root root 1182 Dec  7 05:43 bluetooth.conf
-rw-r--r-- 1 root root  382 Dec  8 01:23 com.helium.Config.conf
-rw-r--r-- 1 pi   pi    380 Dec  1 10:28 com.helium.Miner.conf
-rw-r--r-- 1 root root  752 Mar  5  2021 com.hp.hplip.conf
-rw-r--r-- 1 root root  792 Jan 13  2021 com.redhat.NewPrinterNotification.conf
-rw-r--r-- 1 root root  799 Jan 13  2021 com.redhat.PrinterDriversInstaller.conf
-rw-r--r-- 1 root root 1180 Oct 17 16:29 org.freedesktop.DisplayManager.conf
-rw-r--r-- 1 root root 1331 Dec 22  2020 org.freedesktop.PackageKit.conf
-rw-r--r-- 1 root root  535 Nov 12  2020 org.opensuse.CupsPkHelper.Mechanism.conf
-rw-r--r-- 1 root root 1084 Apr 15  2021 pulseaudio-system.conf
-rw-r--r-- 1 root root 1160 Feb 25  2021 wpa_supplicant.conf

the 'dbus-send' check command result

pi@raspberrypi:/etc/dbus-1/system.d $ dbus-send --system --print-reply --dest=com.helium.Miner / com.helium.Miner.P2PStatus
Error org.freedesktop.DBus.Error.ServiceUnknown: The name com.helium.Miner was not provided by any .service files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant