I’ve been successfully using the Metabase droplet for quite a while.
Few days ago, I tried opening the link I normally use and I get an error (tried every browser).
The droplet itself is active, I tried rebooting it a few time, but nothing.
I was wondering if anyone could help on the necessary steps to troubleshoot the problem.
Thanks a lot.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
5 answers

Hello, @caioac87 @dwihdyn789

If you can’t see java running when you use netstat than it means that Metabase is not running on your droplet.

You can confirm this by executing the following command:

service metabase status

If the service is not started you can start/restart it:

sudo service metabase start

Note: This might take up some time to run and actually start the service, if you still can’t access the Metabase in your browser try to manually start it using the commands bellow

The script that start the service is:

/opt/metabase/metabase.sh

You can execute this and wait for couple of minutes to complete.

You also need to start Java by executing the following command:

java -jar /opt/metabase/metabase.jar

If this is a new droplet I will recommend you to quickly spin up a new Metabase droplet as this will take less than 10 minutes to have it up and running.

Hope this helps!

Regards,
Alex

  • @alexdo it works! Thank you and appreciate your swift responds :)

    Do you have any idea how does this even happen ya ? because i’ve been using metabase for 2 months non-stop, and its all work well. only then at one day, it decided to shut down by itself

    Would be grateful if you could share your thought, so me and the other developers who encounter this same issue can go back to this question and able to fix the issue ourselves!

    • Hello, @dwihdyn789

      I’m glad this is working for you! :)

      What I did in order to replicate the issue was to spin up a test Metabase droplet and then simply stopped the Metabase service with this command:

      sudo service metabase stop
      

      Once this was done, Java was not listening on the port 3000 and then I’ve executed the commands I’ve already provided. My guess here will be that something stopped/killed the java process that is running on port 3000 and caused the issue for you. The other explanation is that the Metabase service died unexpectedly. What you can do in order to check what happened is to examine the logs to check what went wrong.

      You can check the Metabase log which should be located in /var/log/metabase.log and check for any killed processes in /var/log/messages like this:

      grep -i kill /var/log/messages```
      

      Regards,
      Alex

      • Hi @alexdo,

        Ever since that i followed your solution on using sudo service metabase start , my metabase tends to crash much more often with the output below when i check using sudo service metabase status :

        ● metabase.service - Metabase
           Loaded: loaded (/etc/systemd/system/metabase.service; enabled; vendor preset: enabled)
           Active: failed (Result: exit-code) since Wed 2020-04-01 20:01:37 UTC; 13h ago
          Process: 20014 ExecStart=/opt/metabase/metabase.sh (code=exited, status=137)
         Main PID: 20014 (code=exited, status=137)
        

        How can i solve this issue to make sure that it does not crash oftenly ya ? also i tried to find the log just to figure out the issue at /var/log/metabase.log . Given file does not exist. Where can i find it ya ?

        Thank you,
        Dwi

        • Hello, @dwihdyn789

          What you can do is to set a cron job that will check if the metabase service is running and if not to start it automatically. The cron job can be configured to run once every minute.

          As for the errorlog if the file is not present you can check the metabase configuration file and check if the errorlog is saved in different directory.

          Also the log file location can be specified when running the java command:

          -Dlogfile.path=/path
          

          Also you can check the syslog for any logged error messages as well.

          Hope this helps!

          Regards,
          Alex

          • Hi @alexdo,

            Thank you for the answer, however ive been trying to setup cronjob for metabase and seems that its still not working

            Could you share us the code for the cronjob here that it will run every minute ? would really means alot

            Really appreciate it and thank you!
            Dwi

Hello, @caioac87

May I ask if you access the site using a domain name or via the IP address of your server/droplet? If you’re using a domain name can you please check/verify that the domain name is properly pointed to your droplet and that the DNS is working fine? You can use https://www.whatsmydns.net/ and check if the A record is pointed to the IP address of your server.

Let me know how it goes.

I’m using the IP address… no DNS setup

  • Hello, @caioac87

    Can you please make sure that java is running on port 3000? I’ve just spin a test Metabase droplet and everything is working just fine. You can check if Java is running with netstat:

    netstat -plunt | grep 3000
    

    Note: Please note that a Metabase droplet is deployed allow 2 to 5 minutes so that Metabase starts all required services. This delay only happens when the droplet is created and not afterwards.

    Another option is to access by using an ssh tunnel, with nice benefit of being encrypted. Run this command from the terminal:

    ssh -f root@134.209.125.2 -L 3000:134.209.125.2:3000 -N
    

    And then, from the browser go to localhost:3000. The first step with Metabase is to create an administrator for the application, complete the information and add a password that can be the same as the password for system administrator paul or a different password.

    Hope this Helps!

    Regards,
    Alex

Hi @alexdo, Im having the same issue right here, where Im using IP address to access, and i am encountering the same issue. Appreciate if you could assist us on this issue :)

This site can’t be reached
111:111:11:11  refused to connect.

Hi @caioac87 , have you managed to find any solution for this ?

  • Hello, @dwihdyn789

    Can you please make sure that java is running on port 3000? I’ve just spin a test Metabase droplet and everything is working just fine. You can check if Java is running with netstat:

    netstat -plunt | grep 3000
    

    Note: Please note that a Metabase droplet is deployed allow 2 to 5 minutes so that Metabase starts all required services. This delay only happens when the droplet is created and not afterwards.

    Another option is to access by using an ssh tunnel, with nice benefit of being encrypted. Run this command from the terminal:

    ssh -f root@134.209.125.2 -L 3000:134.209.125.2:3000 -N
    

    And then, from the browser go to localhost:3000. The first step with Metabase is to create an administrator for the application, complete the information and add a password that can be the same as the password for system administrator paul or a different password.

    Hope this Helps!

    Regards,
    Alex

    • Hi @alexdo, did that and nothing works :(

      we ran netstat -plunt | grep 3000 , nothing came out

      and when i ran ssh -f root@134.209.125.2 -L 3000:134.209.125.2:3000 -N, below are the output :

      channel 3: open failed: connect failed: Connection refused
      channel 2: open failed: connect failed: Connection refused
      channel 2: open failed: connect failed: Connection refused
      channel 3: open failed: connect failed: Connection refused
      channel 2: open failed: connect failed: Connection refused
      channel 2: open failed: connect failed: Connection refused
      channel 3: open failed: connect failed: Connection refused
      channel 2: open failed: connect failed: Connection refused
      channel 2: open failed: connect failed: Connection refused
      channel 3: open failed: connect failed: Connection refused
      

      Our last resort will be destroy this current droplet & re-create the Metabase droplet from marketplace, hopefully we dont need to go down that path, as there are my data in psql are there

      Any other method i should try ?

      Thank you

      • If you can’t see java running when you use netstat than it means that Metabase is not running on your droplet.

        You can confirm this by executing the following command:

        service metabase status

        If the service is not started you can start/restart it:

        sudo service metabase start

        Note: This might take up some time to run and actually start the service, if you still can’t access the Metabase in your browser try to manually start it using the commands bellow

        The script that start the service is:

        /opt/metabase/metabase.sh

        You can execute this and wait for couple of minutes to complete.

        You also need to start Java by executing the following command:

        java -jar /opt/metabase/metabase.jar

        If this is a new droplet I will recommend you to quickly spin up a new Metabase droplet as this will take less than 10 minutes to have it up and running.

        Hope this helps!

        Regards,
        Alex

Hey, @dwihdyn789

You can create a simple bash script to check if the service is running and if not to start it. You can then execute the bash script with a cron job whenever you want (once per minute and etc)

#!/bin/bash

service=$@
/bin/systemctl -q is-active "$metabase.service"
status=$?
if [ "$status" == 0 ]; then
    echo "OK"
else
    /bin/systemctl start "$metabase.service"
fi

You can check this task for creating cron jobs:

https://www.digitalocean.com/community/tutorials/how-to-use-cron-to-automate-tasks-ubuntu-1804

The cron job should look like:

* * * * * /bin/sh /path/to/script/script.sh > /dev/null 2>&1

* * * * * - Run the command every minute.

Hope this helps!

Regards,
Alex

by Mark Drake
Cron is a time-based job scheduling daemon found in Unix-like operating systems, including Linux distributions. This guide provides an overview of how to schedule tasks using cron's special syntax on a machine running Ubuntu 18.04. It also goes over a few shortcuts one can use to make job schedules easier to write and understand.
Submit an Answer