Steem Node-in-a-box FAQ / Help

How do I update Steem-in-a-box (SIAB) or the Steem software on my Node-in-a-box (NIAB) server?

Updating Steem-in-a-box (SIAB)

You can update SIAB's core files (the application which helps with managing Steem nodes) very easily, and you do not have to stop/restart your node to do this.

Simply run the following commands, in order:

su
cd /steem
git checkout master
git pull

Your Steem-in-a-box core files are now up to date :)

Updating Steem itself

For minor updates which don't require a replay, for example upgrading from 0.22.1 to 0.22.2, you may do this yourself quite easily.

Before updating, make sure your SIAB core files are up to date (see above), as there may be important fixes to SIAB itself that are needed to upgrade Steem safely.

To update to the latest available Steem image:

su
cd /steem
./run.sh install latest-mira
./run.sh restart

Check the logs to see if the update was successful or not:

./run.sh logs

For MAJOR updates which may require a replay, for example upgrading from 0.22.2 to 0.23.0, we recommend checking our Discord and waiting until we've released an updated pre-replayed Steem image for the software update.

Then you may contact Privex Support and ask for your server to be re-installed with the latest Node-in-a-box image.

Help, my /var/lib/docker folder is full!

Old docker images

If you've had your Node-in-a-box server for a while, it's likely that you've accumulated a lot of old docker images that are eating up disk space.

Use the command docker images to view the currently installed Docker images

steemseed-se :: /steem ‹master*› » docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
steem               latest              f2f8cf0342bb        2 hours ago         1.49GB
someguy123/steem    latest-mira         f2f8cf0342bb        2 hours ago         1.49GB
someguy123/steem    <none>              93df4e15cd21        5 months ago        1.49GB
<none>              <none>              410a51bc3f9b        5 months ago        1.04GB
steemit/jussi       latest              c9644f83413e        5 months ago        2.2GB
ubuntu              bionic              a2a15febcdf3        6 months ago        64.2MB

It should generally be safe to remove images for someguy123/steem that are older than the latest version installed.

Do not remove the ubuntu docker image however - it's used by someguy123/steem. Removing the Ubuntu docker image may break your install.

You can delete old images by running:

docker rmi [image_id]

In some cases, you may get an error about the image being used by a "stopped container". This means that there's an old container based on the image that wasn't removed properly after it was shutdown.

To see all containers, including stopped containers, use the command:

docker ps -a

You can then remove any un-needed containers using:

docker rm [container_id]

Below is an example of this scenario:

# We can't remove this old someguy123/steem image because there's a stopped container using it...
steemseed-se :: /steem ‹master*› » docker rmi 93df4e15cd21
Error response from daemon: conflict: unable to delete 93df4e15cd21 (must be forced) - image is being used by stopped container 56f6b478dda5

# We can see the container was running Steem's cli_wallet, but wasn't removed correctly after the wallet was closed
steemseed-se :: /steem ‹master*› » docker ps -a 
CONTAINER ID        IMAGE                  COMMAND                  CREATED             STATUS                      PORTS                              NAMES
56f6b478dda5        93df4e15cd21           "cli_wallet -s ws://…"   5 months ago        Exited (255) 5 months ago                                      quizzical_pasteur

# Now let's remove that old wallet container - it won't touch your Steem node's wallet, that's stored OUTSIDE of docker.
steemseed-se :: /steem ‹master*› » docker rm 56f6b478dda5
56f6b478dda5

# We can finally remove that old someguy123/steem image
steemseed-se :: /steem ‹master*› » docker rmi 93df4e15cd21
Untagged: someguy123/steem@sha256:d4ef39ce9d73f72cb9d6319c29bb57ac4c08106a54a68f098d39a24b70b44702
Deleted: sha256:93df4e15cd21016af0b58972ed1cbfd4611dabde88a8ccf1a21bc4d57f7311a7
Deleted: sha256:829ae06d00cd6f5c6b27dc8bec17f9168e7c3955a0ff68da04e2533990a48495
Deleted: sha256:b07a516d052c9975e5f2b445d7b0e50de81a6adfc6e79e2b754c3ff7e1a616ee
Deleted: sha256:b830334c638652fcb7094287328948a365f280ab81b0e7ea3d18fc093aec4613

Large docker log files

On some of our older Node-in-a-box servers, Docker wasn't configured to correctly handle log rotation (splitting logs when they get too big, plus compressing / removing older log files).

This can result in log files getting as big as several gigabytes!

Before you're able to properly remove the log files, you'll need to stop your Steem server, as well as the Docker daemon.

su
cd /steem
./run.sh stop
 systemctl stop docker

To find these log files, we recommend using the program ncdu. You can install it from apt:

apt update
apt install -y ncdu

Run ncdu against the docker folder:

ncdu /var/lib/docker

You can select files/folders with your arrow keys, and to look inside of a folder just hit ENTER (RETURN).

To go back a folder (upwards), select the folder /.. at the top of ncdu and hit ENTER

Docker log files are generally named with the extension -json.log. These are the files you want to look for and delete.

Usually, you'll find the log files within sub-folders of /var/lib/docker/containers. For example, in the image above, you can see there's a log file taking up 5.1mb of space:

5ab7395c713f9adade36d0cbe91a4f97c6e1e0ecd070ca353cfa6ea1ff3614c0-json.log

To delete a file from ncdu, just select the file with your arrow keys, and then press the letter D on your keyboard.

Select "yes" with your arrow keys, and then hit ENTER to delete the file.

Repeat this for each large log file you find.

Once you've finished removing log files, press the letter Q to exit ncdu.

Remember to start the Docker daemon again, as well as your Steem node:

systemctl start docker
cd /steem
./run.sh start

Preventing large Docker log files

If you purchased / had your Node-in-a-box server re-installed after Mon, 24th Feb 2020 - then you can ignore this section.

Our Steem "node-in-a-box" images are pre-configured with Docker log rotation as of the above date.

Otherwise, follow the commands below to setup Docker log rotation, which will prevent logs from filling up your /var/lib/docker partition.

First, make sure you're logged in as root by using the command su (or sudo su - on some systems):

su

Next, copy the entire command block below, paste it into your terminal, and then press ENTER:

cat > /etc/docker/daemon.json <<"EOF"
{
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "200m",
        "max-file": "4",
        "compress": "true"
    }
}
EOF

Stop your Steem node:

cd /steem
./run.sh stop

Restart the Docker daemon:

systemctl restart docker

Now start your Steem node again:

./run.sh start

Now, whenever the log file for a Docker container exceeds 200MB, Docker will start a new log file, and compress the old one.

If a container has more than 3 old log files (4 including the current active log), then the oldest log file will be removed.

This means that each Docker container can have no more than 800MB of log files (assuming the old log files didn't compress well).