Answers: <p><code>Exec format error</code> means you're having CPU architecture mismatch. For Mac M1 you need to download <code>arm64</code> Prometheus binary.</p>
  
Answers: CC BY-SA 4.0
Answers: 2024-04-24T11:01:17.353Z
Answers: Ah, I'm not used to using it, so I thought to go with Linux AMD. Still learnning, and thank you!
Answers: drew
Answers: CC BY-SA 4.0
Answers: 2024-04-23T19:27:57.477Z
Answers: 2024-04-23T19:27:57.477Z
Answers: Vasilii Angapov
Answers: <p>Have you verified the configuration file is valid? See <a href="https://www.robustperception.io/how-to-check-your-prometheus-yml-is-valid/" rel="nofollow noreferrer">How to check your prometheus.yml is valid</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2024-04-23T18:05:47.373Z
Answers: 2024-04-23T18:05:47.373Z
Answers: mikequentel
Body: <p>I am trying to run Prometheus on my Ubuntu Linux VM on a Mac M1 (if those details are necessary).</p>
  <pre><code>OS: Ubuntu 23.10
  </code></pre>
  <pre><code>Prometheus: 2.51.2
  </code></pre>
  <p>I make the config files, and as I run the following lines,</p>
  <pre><code>sudo systemctl daemon-reload
  sudo systemctl start prometheus
  sudo systemctl status prometheus
  </code></pre>
  <p>I am met with this error:</p>
  <pre><code>prometheus.service - Prometheus
       Loaded: loaded (/etc/systemd/system/prometheus.service; enabled; preset: enabled)
       Active: failed (Result: exit-code) since Tue 2024-04-23 15:52:29 UTC; 20s ago
     Duration: 3ms
      Process: 4410 ExecStart=/usr/local/bin/prometheus --config.file /etc/prometheus/prometheus.yml --storage.tsdb.path /var/lib/prometheus/ --web.console.templates=/etc/prometheus/consoles --web.console.libraries=/etc/prometheus/console_libraries (code=exited, status=203/EXEC)
     Main PID: 4410 (code=exited, status=203/EXEC)
          CPU: 1ms
  
  Apr 23 15:52:29 uutobobuntu systemd[1]: Started prometheus.service - Prometheus.
  Apr 23 15:52:29 uutobobuntu (ometheus)[4410]: prometheus.service: Failed to execute /usr/local/bin/prometheus: Exec format error
  Apr 23 15:52:29 uutobobuntu (ometheus)[4410]: prometheus.service: Failed at step EXEC spawning /usr/local/bin/prometheus: Exec format error
  Apr 23 15:52:29 uutobobuntu systemd[1]: prometheus.service: Main process exited, code=exited, status=203/EXEC
  Apr 23 15:52:29 uutobobuntu systemd[1]: prometheus.service: Failed with result 'exit-code'.
  </code></pre>
  <p>This is the systemd service file:</p>
  <pre><code>[Unit]
  Description=Prometheus
  Wants=network-online.target
  After=network-online.target
  
  [Service]
  User=prometheus
  Group=prometheus
  Type=simple
  ExecStart=/usr/local/bin/prometheus \
      --config.file /etc/prometheus/prometheus.yml \
      --storage.tsdb.path /var/lib/prometheus/ \
      --web.console.templates=/etc/prometheus/consoles \
      --web.console.libraries=/etc/prometheus/console_libraries
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  <p>(I have also tried with WantedBy=default.target)</p>
  <p>I have tried with multiple VMs, but I keep running into the same issues. Every time I run the three lines, it immediately errors, and I am yet to find success.</p>
  
Tags: <linux><prometheus><ubuntu>
Title: Prometheus not Starting (Exec Format Error)
UserDisplayName: drew
ThreadText: # Prometheus not Starting (Exec Format Error)
  
  (Asked by: username_0 on 2024-04-23)
  
  I am trying to run Prometheus on my Ubuntu Linux VM on a Mac M1 (if those details are necessary).
  
  ```
  OS: Ubuntu 23.10
  
  ```
  
  ```
  Prometheus: 2.51.2
  
  ```
  
  I make the config files, and as I run the following lines,
  
  ```
  sudo systemctl daemon-reload
  sudo systemctl start prometheus
  sudo systemctl status prometheus
  
  ```
  
  I am met with this error:
  
  ```
  prometheus.service - Prometheus
       Loaded: loaded (/etc/systemd/system/prometheus.service; enabled; preset: enabled)
       Active: failed (Result: exit-code) since Tue 2024-04-23 15:52:29 UTC; 20s ago
     Duration: 3ms
      Process: 4410 ExecStart=/usr/local/bin/prometheus --config.file /etc/prometheus/prometheus.yml --storage.tsdb.path /var/lib/prometheus/ --web.console.templates=/etc/prometheus/consoles --web.console.libraries=/etc/prometheus/console_libraries (code=exited, status=203/EXEC)
     Main PID: 4410 (code=exited, status=203/EXEC)
          CPU: 1ms
  
  Apr 23 15:52:29 uutobobuntu systemd[1]: Started prometheus.service - Prometheus.
  Apr 23 15:52:29 uutobobuntu (ometheus)[4410]: prometheus.service: Failed to execute /usr/local/bin/prometheus: Exec format error
  Apr 23 15:52:29 uutobobuntu (ometheus)[4410]: prometheus.service: Failed at step EXEC spawning /usr/local/bin/prometheus: Exec format error
  Apr 23 15:52:29 uutobobuntu systemd[1]: prometheus.service: Main process exited, code=exited, status=203/EXEC
  Apr 23 15:52:29 uutobobuntu systemd[1]: prometheus.service: Failed with result 'exit-code'.
  
  ```
  
  This is the systemd service file:
  
  ```
  [Unit]
  Description=Prometheus
  Wants=network-online.target
  After=network-online.target
  
  [Service]
  User=prometheus
  Group=prometheus
  Type=simple
  ExecStart=/usr/local/bin/prometheus \
      --config.file /etc/prometheus/prometheus.yml \
      --storage.tsdb.path /var/lib/prometheus/ \
      --web.console.templates=/etc/prometheus/consoles \
      --web.console.libraries=/etc/prometheus/console_libraries
  
  [Install]
  WantedBy=multi-user.target
  
  ```
  
  (I have also tried with WantedBy=default.target)
  
  I have tried with multiple VMs, but I keep running into the same issues. Every time I run the three lines, it immediately errors, and I am yet to find success.
  
  **Tags:** linux, prometheus, ubuntu
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2024-04-23. Score: 1
  
  `Exec format error` means you're having CPU architecture mismatch. For Mac M1 you need to download `arm64` Prometheus binary.
  
  > **Comments:**
  > **username_0**: Ah, I'm not used to using it, so I thought to go with Linux AMD. Still learnning, and thank you!  
  
  ---
  
  ### Answer by username_2 on 2024-04-23. Score: 0
  
  Have you verified the configuration file is valid? See [How to check your prometheus.yml is valid](https://www.robustperception.io/how-to-check-your-prometheus-yml-is-valid/)
  
  
  ---
  
  