Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opening storage failed mkdir \": permission denied #5338

Closed
justlooks opened this Issue Mar 12, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@justlooks
Copy link

justlooks commented Mar 12, 2019

Can not use systemd to start prometheus, if I switch to user prometheus ,use command /opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --storage.tsdb.path="/opt/prometheus/data". it can work.

-- Unit prometheus.service has begun starting up.
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.48495451Z caller=main.go:222 msg="Starting Prometheus" version="(version=2.3.2, branch=HEAD, revision=71a
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.485050492Z caller=main.go:223 build_context="(go=go1.10.3, user=root@5258e0bd9cc1, date=20180712-14:02:52
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.485085044Z caller=main.go:224 host_details="(Linux 3.10.0-693.17.1.el7.x86_64 #1 SMP Thu Jan 25 20:13:58
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.485119542Z caller=main.go:225 fd_limits="(soft=1024, hard=4096)"
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.487139851Z caller=main.go:533 msg="Starting TSDB ..."
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.487158076Z caller=web.go:415 component=web msg="Start listening for connections" address=0.0.0.0:9090
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.487247926Z caller=main.go:402 msg="Stopping scrape discovery manager..."
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.487263247Z caller=main.go:416 msg="Stopping notify discovery manager..."
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.487273185Z caller=main.go:438 msg="Stopping scrape manager..."
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.487305241Z caller=manager.go:464 component="rule manager" msg="Stopping rule manager..."
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.487290596Z caller=main.go:398 msg="Scrape discovery manager stopped"
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.487330497Z caller=manager.go:470 component="rule manager" msg="Rule manager stopped"
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.487295745Z caller=main.go:412 msg="Notify discovery manager stopped"
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.48734441Z caller=main.go:432 msg="Scrape manager stopped"
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.487352819Z caller=notifier.go:512 component=notifier msg="Stopping notification manager..."
Mar 12 14:26:50 zabbix prometheus[22057]: level=info ts=2019-03-12T06:26:50.487377479Z caller=main.go:587 msg="Notifier manager stopped"
Mar 12 14:26:50 zabbix systemd[1]: prometheus.service: main process exited, code=exited, status=1/FAILURE
Mar 12 14:26:50 zabbix prometheus[22057]: level=error ts=2019-03-12T06:26:50.487839723Z caller=main.go:596 err="Opening storage failed mkdir \": permission denied"
Mar 12 14:26:50 zabbix systemd[1]: Unit prometheus.service entered failed state.
Mar 12 14:26:50 zabbix systemd[1]: prometheus.service failed.
# cat /lib/systemd/system/prometheus.service
[Unit]
Description=Prometheus Server
Documentation=https://prometheus.io/docs/introduction/overview/
Wants=network-online.target
After=network-online.target

[Service]
User=prometheus
Restart=on-failure
ExecStart=/opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml --storage.tsdb.path="/opt/prometheus/data"

[Install]
WantedBy=multi-user.target
# ls -l /opt/prometheus/
total 113476
drwxr-xr-x  2 prometheus prometheus       38 Jul 12  2018 console_libraries
drwxr-xr-x  2 prometheus prometheus      173 Jul 12  2018 consoles
drwxr-xr-x 25 prometheus prometheus     4096 Mar 12 14:00 data
drwxr-xr-x  2 prometheus prometheus       50 Mar 11 17:44 hosts.d
-rw-r--r--  1 prometheus prometheus    11357 Jul 12  2018 LICENSE
-rw-r--r--  1 prometheus prometheus     2769 Jul 12  2018 NOTICE
-rwxr-xr-x  1 prometheus prometheus 71181678 Jul 12  2018 prometheus
-rw-r--r--  1 prometheus prometheus     3485 Mar 11 17:37 prometheus.yml
-rwxr-xr-x  1 prometheus prometheus 44988845 Jul 12  2018 promtool
drwxr-xr-x  2 prometheus prometheus      115 Mar 11 13:57 rules
@jeasonWujun

This comment has been minimized.

Copy link

jeasonWujun commented Mar 12, 2019

Are you working under root?

@simonpasquier

This comment has been minimized.

Copy link
Member

simonpasquier commented Mar 12, 2019

Thanks for your report. It looks as if this is actually a question about usage and not development.

To make your question, and all replies, easier to find, we suggest you move this over to our user mailing list, which you can also search. If you prefer more interactive help, join or our IRC channel, #prometheus on irc.freenode.net. Please be aware that our IRC channel has no logs, is not searchable, and that people might not answer quickly if they are busy or asleep. If in doubt, you should choose the mailing list.

Once your questions have been answered, please add a short line pointing to relevant replies in case anyone stumbles here via a search engine in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.