How to start Home Assistant Code stopped from web UI - home-assistant

I am unable to start Home Assistant Core running on docker post it is stopped from "Server Controls" in web UI.

Easy answer: restart the host. If I'm not wrong, by default, HA restarts with the host.
If that does not work, you can start your docker container.
Run: docker ps -a to get the list of all available containers. Identify the HA one. You should have something like this:
afa90071dd81 homeassistant/intel-nuc-homeassistant:0.118.5 "/init" 13 hours ago Up 13 hours homeassistant
ac4fe3306d98 homeassistant/amd64-hassio-supervisor "/init" 13 hours ago Up 13 hours hassio_supervisor
(note that the status should be stopped in your case).
Then, you just need to start your HA container.
In the example case, that requires docker start homeassistant or docker start afa90071dd81.

Related

Red Hat CodeReady containers - unable to access github.com

I have installed and setup CodeReady containers on my mac, tried creating a project using the sample node js application, but the build is failing with this message in the logs.
Do we need to do any changes to CodeReady containers to access github.com ?
Cloning "https://github.com/sclorg/nodejs-ex.git" ...
error: fatal: unable to access 'https://github.com/sclorg/nodejs-ex.git/': Could not resolve host: github.com
I tried your command on crc. It worked for me.
No additional steps required.
$ oc new-app https://github.com/sclorg/nodejs-ex
--> Found image db4e490 (2 months old) in image stream "openshift/nodejs" under
...
...
Run 'oc status' to view your app.
I assume you can access the github.com from your laptop. :)
Let's see if you can resolve GitHub from crc virtual VM.
From your laptop.
$ host api.crc.testing
$ ssh -i ~/.crc/machines/crc/id_rsa core#192.168.130.11
Now check if you can resolve github
[root#crc-fdm75-master-0 ~]$ host github.com
github.com has address 13.234.210.38
github.com mail is handled by 1 aspmx.l.google.com.
github.com mail is handled by 10 alt3.aspmx.l.google.com.
github.com mail is handled by 10 alt4.aspmx.l.google.com.
github.com mail is handled by 5 alt1.aspmx.l.google.com.
github.com mail is handled by 5 alt2.aspmx.l.google.com.
If it is not working then your installation has a problem. Try to do a fresh setup again.
crc stop
crc clean-up
crc setup
crc start
Let us see how it goes.
BTW I use Fedora, not mac. I think the OS does not matter here.

Elastic Beanstalk stops at EbExtensionPostBuild

I am having a problem deploying an EB instance with a custom .ebextensions file. This is the relevant part in that file:
container_commands:
01_migrate:
command: 'python db_migrate.py'
02_npm_build:
command: 'npm install && npm run prod'
As you can see, these commands are for migrating my PostgreSQL database (via a Flask backend) and building my React .jsx files.
If I leave these commands out, the deployment completes perfectly well. However, once I put them in, looking at the eb-activity.log it stalls at this part forever (as far as I can tell):
[2017-04-10T02:39:24.106Z] INFO [3023] - [Application deployment app-613e-170409_223418#1/StartupStage0/EbExtensionPostBuild] : Starting activity...
I also get this message on the Health overview in the console (this is after 1 day):
Performing application deployment (running for 1 day).
I have also tried to deploy it without those container_commands, and then including it back after the successful initial deployment. Then I get the same error message as before in eb-activity.log, and I also get this message on the Health overview:
Incorrect application version "app-2a3d-170409_214923" (deployment 1). Expected version "app-2a3d-170409_214923" (deployment 1).
Which is very strange because those two versions referenced are the same versions. I don't know what this means!
I found a solution.
Remove all you container_commands from .ebextensions/
Go ssh to instance, kill process with.
sudo killall python
Then Deploy new version without container_commands.
And start debuging all your container_commands, one by one on ssh..
Have fun.

OpenShift-Ansible with MS Active Directory

Environment:
NAME="Red Hat Enterprise Linux Atomic Host"
VERSION="7.3"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Atomic Host"
VARIANT_ID=atomic.host
VERSION_ID="7.3"
PRETTY_NAME="Red Hat Enterprise Linux Atomic Host 7.3"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.3:GA:atomic-host"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.3
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION=7.3
OpenShift-Ansible Version:
3.6.11-1
This is openshift-ansible setup with Atomic hosts, so OpenShift itself is containerized.
Question:
Has anyone configured OpenShift using OpenShift-Ansible for MS Active Directory? I found this reference, but it implies that OpenShift master node service runs under systemd:
http://www.greenreedtech.com/openshift-origin-active-directory-integration/
Any suggestions?
(Unfortunately, I don't have ability to test it but) OpenShift documentation says that
The installation process creates relevant systemd units which can be used to start, stop, and poll services using normal systemctl commands.
So, I'd expect that command systemctl restart origin-master should work (except, in your case it will be atomic-openshift-master)
It also says that
configuration files are placed in the same locations during containerized installation as RPM based installations
so I'd expect that this instruction would work.

How to make Docker to avoid V1 registry

Docker versions 1.6 and above use the Docker Registry V2 API however it is still liable to make requests looking for an old V1 registry. I think I saw there is a configuration option to make Docker avoid making any /v1/ requests.
I saw this option very recently but now I can't find it. I suspect it was in a page linked to by the Docker email that told us the Registry will stop supporting Docker versions prior to 1.6
I know Docker only looks for a V1 registry when it has no luck looking for /v2 but I want to stop it altogether. How can I stop Docker making requests to /v1/ registry URLs under any circumstances ?
--disable-legacy-registry
"prevents the docker daemon from pull, push, and login operations against v1 registries." -
Source

Upstart node.js mysql connection

I am new to node.js so in an attempt to learn it I tried to run this example
http://markshust.com/2013/11/07/creating-nodejs-server-client-socket-io-mysql
It has no problems and everything is working fine. But then I wanted to run this server through forever and upstart, and a strange problem occured. When I first reboot the system, upstart runs the server fine, but the server script doesn't list mysql entries. But when I kill the server and forever starts it up again, everything works fine. Could you help me with this? Here is my upstart conf.
#!upstart
description "Forever and Node.js"
start on (starting mysql)
stop on shutdown
expect fork
env NODE_BIN_DIR="***"
env NODE_PATH="***"
env APPLICATION_DIRECTORY="***"
env APPLICATION_START="***"
env LOG="***"
script
PATH=$NODE_BIN_DIR:$PATH
exec forever --sourceDir $APPLICATION_DIRECTORY -a -l $LOG --minUptime 5000 -- spinSleepTime 2000 start $APPLICATION_START
end script
pre-stop script
PATH=$NODE_BIN_DIR:$PATH
exec forever stop $APPLICATION_START >> $LOG
end script
Replacing
start on (starting mysql)
with
start on (started mysql)
fixed the problem. Thank you all for this priceless community.