Server started but no access on localhost:3000

Hi,
I’m very enthousiastic about Grafana using it as a Home Assistant add-on on a Raspberry Pi. Now I’m trying to install Grafana on a Mac (Catalina) using Homebrew. Installation goes without errors. Service is running, but I cannot acces the 3000 port using my Chrome browser.
Any ideas what went wrong.
Tx
PPee

Hi, I have the same problem and no clue on how to solve it.

Does the Mac have the “netstat” or “ss” commands, as Linux does?

If so, try “netstat -lptn” or “ss -ltp”; that should give you a list of all
listening TCP ports together with the application that’s listening there.

You can check whether 3000 really is attached to something, and/or whether
Grafana is listening on some other port.

Also, try increasing the logging level from the default and restart the
service, then see what you find in Grafana’s log file.

Hope that helps,

Antony.

Hello, the syntax for MacOS to check active internet connections seems to be:
netstat -ap tcp

Running it I get the following result:

Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 24 0 192.168.0.42.52140 185.42.117.123.https CLOSE_WAIT
tcp6 0 0 2a01:e0a:29a:5db.52135 2001:470:1:791::.https ESTABLISHED
tcp6 0 0 2a01:e0a:29a:5db.52133 par21s04-in-x02…https ESTABLISHED
tcp6 0 0 2a01:e0a:29a:5db.52132 par21s04-in-x02…https ESTABLISHED
tcp6 0 0 2a01:e0a:29a:5db.52131 par21s05-in-x04…https ESTABLISHED
tcp6 0 0 2a01:e0a:29a:5db.52129 par21s05-in-x04…https ESTABLISHED
tcp4 0 0 192.168.0.42.52069 lb-140-82-114-25.https ESTABLISHED
tcp4 0 0 192.168.0.42.52051 192.168.0.31.51181 ESTABLISHED
tcp4 0 0 192.168.0.42.52053 ec2-34-237-73-95.https ESTABLISHED
tcp4 0 0 192.168.0.42.52052 17.242.176.141.5223 ESTABLISHED
tcp6 0 0 *.52051 . LISTEN
tcp4 0 0 *.52051 . LISTEN

I am not an expert but I don’t think any connection with Grafana’s server is being achieved here.

Any advice?

Also, can you explain what you mean by increasing the logging level?

Thank you,
Miky

Also, in the log directory there is a .log file reporting several times the sentence:

/usr/local/opt/grafana/bin/grafana-server: /usr/local/opt/grafana/bin/grafana-server: cannot execute binary file

I don’t know if this is in any way related with the problem. Hopefully it can help.

Miky

Hello, the syntax for MacOS to check active internet connections seems to
be: netstat -ap tcp

No, you don’t want to check for active connections - you want to check for
listening connections.

Does the Mac’s netstat command have an “l” option (that’s lower-case ell, not
upper-case eye)?

Also, can you explain what you mean by increasing the logging level?

The default level is “info”. Try raising that to “debug” to see if it gives
you further useful information.

Also, in the log directory there is a .log file reporting several times the
sentence:

/usr/local/opt/grafana/bin/grafana-server:
/usr/local/opt/grafana/bin/grafana-server: cannot execute binary file

That’s certainly a bad sign.

Earlier you replied to the original poster who said “Service is running” with
“I have the same problem”.

Have you confirmed that the Grafana service really is running (if so, how have
you confirmed)?

With an error message like that, it seems that the file cannot be executed, but
whether that’s because it doesn’t have the execute bit set, or whether it’s
something to with Macs or Hombrew, I cannot tell (and have no experience of).

Regards,

Antony.

Hello Antony,

Thanks for your time. I could confirm service is running based on the message I get on the terminal when I run brew services (re)start grafana, which is:
Successfully started grafana (label: homebrew.mxcl.grafana)
In general, apart from the error message (which I have found because I was searching for it), during the installation procedure no sign of error appeared.

I was also able to check for listening connections: once again, no sign of port 3000, as I get:

tcp6 0 0 *.54361 . LISTEN
tcp4 0 0 *.54361 . LISTEN
674fc3f2e5db6d95 stream 0 0 674fc3f2eba0bbcd 0

I have also tried to uncomment the line of log level and change to debug. However, nothing more than the usual line (…cannot execute binary file) shows in the log.

I wonder whether in this case it may be useful to put a webserver like Nginx or Apache in front of Grafana and have them proxy requests to Grafana.

Thanks,
Miky

I have now tried to reinstall Grafana. At the end of a seemingly successful process, I get:
To have launchd start grafana now and restart at login:
brew services start grafana
Or, if you don’t want/need a background service you can just run:
grafana-server --config=/usr/local/etc/grafana/grafana.ini --homepath /usr/local/share/grafana --packaging=brew cfg:default.paths.logs=/usr/local/var/log/grafana cfg:default.paths.data=/usr/local/var/lib/grafana cfg:default.paths.plugins=/usr/local/var/lib/grafana/plugins

So, just to change approach, I run the background-service-less line. Here, more explicitly, I get on terminal:
zsh: exec format error: grafana-server

Doing a google search, I find:

Although I don’t understand much of the jargon, the main idea behind the issue seems to be that mac binaries are not linux compatible.

At this point, I ask again the question above about using third-party webservers.
In general, any new advice?

Thanks,
Miky

So, just to change approach, I run the background-service-less line. Here,
more explicitly, I get on terminal: zsh: exec format error: grafana-
server

Okay, that’s useful.

Doing a google search, I find:
https://github.com/grafana/grafana/issues/7403

Although I don’t understand much of the jargon, the main idea behind the
issue seems to be that mac binaries are not linux compatible.

No, I wouldn’t expect them to be.

You’re running on a Mac, right? What version of Grafana did you install (I
don’t mean the version number, I mean the platform it was built for)?

Antony.

The compressed file used for grafana installation is named:
grafana-6.4.2.catalina.bottle.tar.gz
I think it should be fine as I’m running macOS 10.15 (Catalina) on my device.

Thanks,
Miky

Any tentative solution?