# Systemd services doesn't start

**URL:** <https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720>\
**Category:** Setup\
**Tags:** english\
**Created:** [October 29, 2019, 8:03am UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720 "2019-10-29T08:03:19Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![OnlineAlone](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/onlinealone/32/642_2.png) [@OnlineAlone](https://forum.metasfresh.org/u/OnlineAlone)\
**Post date:** [October 29, 2019, 8:03am UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/1 "2019-10-29T08:03:19Z")

</div>

metasfresh v5.123 installed successfully on Ubuntu 16.04 using install script but only `http://address:8080` were accessible just after installation and after reboot(s) metasfresh services doesn’t starts.

 ![metasfresh%20services](https://forum.metasfresh.org/uploads/default/original/1X/f3a279d6b8019db1e77896b45affca00f8e5e887.png)

checking out,

```auto
systemctl status metasfresh_server.service

metasfresh_server.service - metasfresh_server
   Loaded: loaded (/etc/systemd/system/metasfresh_server.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2019-10-29 11:24:54 +04; 33min ago
  Process: 1046 ExecStart=/opt/metasfresh/metasfresh_server.jar (code=exited, status=1/FAILURE)
 Main PID: 1046 (code=exited, status=1/FAILURE)

```

start it manually shows running but `http://address` shows blank page.

Please advise, Thanks

---

<div class="post-metadata">

**Author:** ![julian.bischof](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/julian.bischof/32/36_2.png) [@julian.bischof](https://forum.metasfresh.org/u/julian.bischof)\
**Post date:** [October 29, 2019, 9:20am UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/2 "2019-10-29T09:20:26Z")

</div>

Hi @OnlineAlone

Looks like something went wrong during installation or automatic configuration.

You might want to check the logs of the main application service which you can find here:

```auto
/opt/metasfresh/log

```

Also check if the PostgreSQL Server is running properly:

```bash
systemctl status postgresql

```

Cheers,  
Julian

---

<div class="post-metadata">

**Author:** ![OnlineAlone](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/onlinealone/32/642_2.png) [@OnlineAlone](https://forum.metasfresh.org/u/OnlineAlone)\
**Post date:** [October 29, 2019, 9:39am UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/3 "2019-10-29T09:39:41Z")

</div>

Hi @julian.bischof Thanks for reply.

yeah I’m trying to figure out the issue, PostgreSQL connection failed while the server is running,

 ![Running%20Servers](https://forum.metasfresh.org/uploads/default/original/1X/f39abb9a0f3a1557c280e78372e790b899b85a5c.png)

well, I’m not sure if this is the proper way or not but it just works after I added HOSTNAME to `/etc/hosts` to be,

```auto
127.0.0.1 localhost
127.0.0.1 HOSTNAME

```

when accessed `http://localhost:8080/serverMonitor` the below line were found in tomcat configs,

```auto
jdbc:postgresql://HOSTNAME:5432/metasfresh?encoding=UNICODE

```

Is that happens because of `meatsfresh_install.sh` ? or by PostgreSQL package itself?  
I think PostgreSQL connections normally picks `localhost` only.

well, it’s accessible now, but `http://localhost` still showing blank page.  
can’t find in log any hints about the root causes, Please advise

---

<div class="post-metadata">

**Author:** ![julian.bischof](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/julian.bischof/32/36_2.png) [@julian.bischof](https://forum.metasfresh.org/u/julian.bischof)\
**Post date:** [October 29, 2019, 9:57am UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/4 "2019-10-29T09:57:07Z")

</div>

> [@OnlineAlone](#):
>
> well, it’s accessible now, but `http://localhost` still showing blank page.  
> can’t find in log any hints about the root causes, Please advise

Have you checked your `config.js`? ( [How do I change the hostname (URL) of metasfresh WebUI?](http://docs.metasfresh.org/installation_collection/EN/installer_how_to_change_hostnames_for_webui.html) )

The hostname in the url has to be resolvable by your client-workstation where the browser is running.

So if your URL is `http://myawesomeserver/...` your client PC shall be able to ping `myawesomeserver`.

You might also want to checkout the Docker Installation Method.  
You can run it on any system supported by docker and docker-compose and a lot of config issues that may occur are not present (due to the way docker containers work) - [How to set up the metasfresh stack using Docker?](http://docs.metasfresh.org/installation_collection/EN/How_do_I_setup_the_metasfresh_stack_using_Docker.html)

Cheers.

---

<div class="post-metadata">

**Author:** ![OnlineAlone](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/onlinealone/32/642_2.png) [@OnlineAlone](https://forum.metasfresh.org/u/OnlineAlone)\
**Post date:** [October 29, 2019, 10:05am UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/5 "2019-10-29T10:05:28Z")

</div>

below is `config.js` links,

```auto
const config = {
    API_URL: 'http://127.0.0.1/rest/api',
    WS_URL: 'http://127.0.0.1/stomp'
}

```

well, I install it on notebook to figure out settings and I access it internally for now before I deploy it to VPS,  
I’m not fan of docker actually as matters like backup and restore will be more complicated to me.

---

<div class="post-metadata">

**Author:** ![julian.bischof](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/julian.bischof/32/36_2.png) [@julian.bischof](https://forum.metasfresh.org/u/julian.bischof)\
**Post date:** [October 29, 2019, 10:18am UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/6 "2019-10-29T10:18:45Z")

</div>

Is the `metasfresh-webui-api` service running as well?  
And you might want to check the apache2 reverse-proxy if it resolves correctly to the webapi-service.

> well, I install it on notebook to figure out settings

We HIGHLY recommend running the server on a dedicated machine or on a VM (like eg. Virtualbox).  
Removing the standalone installer with all it’s configs is unfortunately not that easy (one reason we put our main focus on docker these days).

Backups for docker are quite easy: [How do I backup metasfresh database using docker?](http://docs.metasfresh.org/installation_collection/EN/How_do_I_backup_metasfresh_docker.html)

You basically only need to dump your postgresql-database when running a Live Server.

Backing up a non critical docker-installation is even easier:  
stop your containers and tarball the whole folder of your container.  
Voilá - all backed up.

```bash
cd ./metasfresh-docker
docker-compose down
tar cvzf /mybackupstorage/metasfresh.tar.gz ./

```

---

<div class="post-metadata">

**Author:** ![OnlineAlone](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/onlinealone/32/642_2.png) [@OnlineAlone](https://forum.metasfresh.org/u/OnlineAlone)\
**Post date:** [October 29, 2019, 10:27am UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/7 "2019-10-29T10:27:01Z")

</div>

> [@julian.bischof](#):
>
> Removing the standalone installer with all it’s configs is unfortunately not that easy

yeah I understand, on VPS I will proceed with fresh install on fresh system, not by copying files.  
well, I will check out docker documents to get ready before heading to VPS installation.

below are 2 errors logged by apache,

```auto
[proxy:error] AH00959: ap_proxy_connect_backend disabling worker for (localhost) for 60s
[proxy_http:error] [client 127.0.0.1:51484] AH01114: HTTP: failed to make connection to backend: localhost, referer: http://localhost/
[proxy:error] AH00940: HTTP: disabled connection for (localhost)

```

apache config for metasfresh already set for reverse proxy and it should work, Please advise on the above proxy errors, Thanks…

---

<div class="post-metadata">

**Author:** ![julian.bischof](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/julian.bischof/32/36_2.png) [@julian.bischof](https://forum.metasfresh.org/u/julian.bischof)\
**Post date:** [October 29, 2019, 10:31am UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/8 "2019-10-29T10:31:14Z")

</div>

Looks like the service `metasfresh-webui-api` is not running correctly or is not listening on the port the reverse proxy config expects.

check out `/opt/metasfresh/metasfresh-webui-api/log/` for more info.

---

<div class="post-metadata">

**Author:** ![OnlineAlone](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/onlinealone/32/642_2.png) [@OnlineAlone](https://forum.metasfresh.org/u/OnlineAlone)\
**Post date:** [October 29, 2019, 10:48am UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/9 "2019-10-29T10:48:07Z")

</div>

that’s what I found,

```auto
WARN 19974 --- [main] o.apache.activemq.broker.BrokerService : Store limit is 102400 mb (current store usage is 0 mb). The data directory: /opt/metasfresh/activemq-data/localhost/KahaDB only has 80894 mb of usable space - resetting to maximum available disk space: 80894 mb

WARN 9592 --- [ActiveMQ Transport: tcp://HOSTNAME/192.168.43.64:61616@58720] o.a.a.t.failover.FailoverTransport : Transport (tcp://Inspire:61616) failed, attempting to automatically reconnect

```

I don’t know from where this IP comes `192.168.43.64` nothing in my network have address like that.

---

<div class="post-metadata">

**Author:** ![OnlineAlone](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/onlinealone/32/642_2.png) [@OnlineAlone](https://forum.metasfresh.org/u/OnlineAlone)\
**Post date:** [October 29, 2019, 10:57am UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/10 "2019-10-29T10:57:16Z")

</div>

> [@julian.bischof](#):
>
> Backups for docker are quite easy

by considering platform upgrades, kindly brief on data migration from version to another under docker deployment of metasfresh, I checked out this [link](http://docs.metasfresh.org/installation_collection/EN/How_do_I_backup_metasfresh_docker.html) about backup PostgreSQL.

Do I need only the database to restore it with later version? Please advise

sorry, not familiar yet with metasfresh and docker, my concern is to migrate data to upgraded image for metasfresh on later stage.

---

<div class="post-metadata">

**Author:** ![julian.bischof](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/julian.bischof/32/36_2.png) [@julian.bischof](https://forum.metasfresh.org/u/julian.bischof)\
**Post date:** [October 29, 2019, 12:00pm UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/11 "2019-10-29T12:00:58Z")

</div>

> [@OnlineAlone](#):
>
> I don’t know from where this IP comes `192.168.43.64` nothing in my network have address like that.

Usually the IP address is pulled from your primary ethernet adapter (eth0) which on a ideal environment (standalone server/dedicated VM) is assigned statically.  
Rough background is that the application needs to connect to itself and also provide autogenerated configs for external clients to access. Which usually is the primary network interface.

You can change these values in `metasfresh.properties` located in `/opt/metasfresh/` (application server) or `/opt/metasfresh/metasfresh-webui-api/` (webapi server)

---

<div class="post-metadata">

**Author:** ![julian.bischof](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/julian.bischof/32/36_2.png) [@julian.bischof](https://forum.metasfresh.org/u/julian.bischof)\
**Post date:** [October 29, 2019, 12:11pm UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/12 "2019-10-29T12:11:22Z")

</div>

> [@OnlineAlone](#):
>
> Do I need only the database to restore it with later version? Please advise

Generally, yes. You only need the database since all relevant data is stored in there (including some system configs, etc.). Beware though, once an update on a database is performed, you are not able to return to an older version with the same database. So a backup is highly recommended.

How you can generally perform an update is following:

```bash
cd ./metasfresh-docker #the directory containing the docker-compose.yml file
docker-compose down #stop your running metasfresh-docker
tar cvzf /my/backup/location/metasfresh.tar.gz ./ #backup
docker system prune -fa #remove docker images - you won't need them
cp -a ./docker-compose.yml ../ #copy the docker-compose.yml somewhere else so you can keep it on updating
## then follow this guide: http://docs.metasfresh.org/installation_collection/EN/How_do_I_update_metasfresh_using_Docker.html
cp -a ../docker-compose.yml ./ #put your original docker-compose.yml back in place
docker-compose up -d #pull, build and start which will automatically apply update-scripts to the database

```

To restore your backup simply:

```bash
cd ./metasfresh-docker
docker-compose down #stop your new metasfresh-docker version
docker system prune -fa #remove images
rm -rf ./* # just remove everything
cp -a tar cvzf /my/backup/location/metasfresh.tar.gz ./ #put the backup tarball back in place
tar xvzf ./metasfresh.tar.gz #and extract it
docker-compose up -d #pull, build and start which will automatically apply update-scripts to the database

# keep in mind all data between update and restore are lost - so you have exactly the same version as at the time you performed the backup

```

Of course, there are a lot of optimizations you can do with that and automatic backups and redeploys but this is a general concept of how to perform an update and restore a backup.

---

<div class="post-metadata">

**Author:** ![OnlineAlone](https://forum.metasfresh.org/user_avatar/forum.metasfresh.org/onlinealone/32/642_2.png) [@OnlineAlone](https://forum.metasfresh.org/u/OnlineAlone)\
**Post date:** [October 29, 2019, 1:17pm UTC](https://forum.metasfresh.org/t/systemd-services-doesnt-start/1720/13 "2019-10-29T13:17:03Z")

</div>

well, today I learned much about metasfresh with special thanks for your kind support, appreciated really.

I will examine that different scenarios and see how it works, Thanks again!
