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

Only runs with Grafana User #1

Open
marcos-mendez opened this issue Aug 6, 2024 · 1 comment
Open

Only runs with Grafana User #1

marcos-mendez opened this issue Aug 6, 2024 · 1 comment

Comments

@marcos-mendez
Copy link
Member

After some tweaks it stills doenst run underthe hood (with it closed)

root@grafana .../share/grafana# systemctl restart grafana-server.service
root@grafana .../share/grafana# systemctl restart grafana-server
Job for grafana-server.service failed because the control process exited with error code.
See "systemctl status grafana-server.service" and "journalctl -xeu grafana-server.service" for details.
root@grafana .../share/grafana# journalctl -xeu grafana-server.service
-- A start job for unit grafana-server.service has finished successfully.

-- The job identifier is 4453.
Aug 06 03:27:33 grafana (grafana)[5823]: grafana-server.service: Failed to set up mount namespacing: Permission denied
Aug 06 03:27:33 grafana (grafana)[5823]: grafana-server.service: Failed at step NAMESPACE spawning /usr/share/grafana/bin/grafana: Permission denied
-- Subject: Process /usr/share/grafana/bin/grafana could not be executed
-- Defined-By: systemd
-- Support: https://www.debian.org/support

-- The process /usr/share/grafana/bin/grafana could not be executed and failed.

-- The error number returned by this process is ERRNO.
Aug 06 03:27:33 grafana systemd[1]: grafana-server.service: Main process exited, code=exited, status=226/NAMESPACE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support

-- An ExecStart= process belonging to unit grafana-server.service has exited.

-- The process' exit code is 'exited' and its exit status is 226.
Aug 06 03:27:33 grafana systemd[1]: grafana-server.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support

-- The unit grafana-server.service has entered the 'failed' state with result 'exit-code'.
Aug 06 03:27:34 grafana systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: https://www.debian.org/support

-- Automatic restarting of the unit grafana-server.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Aug 06 03:27:34 grafana systemd[1]: Stopped grafana-server.service - Grafana instance.
-- Subject: A stop job for unit grafana-server.service has finished
-- Defined-By: systemd
-- Support: https://www.debian.org/support

-- A stop job for unit grafana-server.service has finished.

-- The job identifier is 4522 and the job result is done.
Aug 06 03:27:34 grafana systemd[1]: grafana-server.service: Start request repeated too quickly.
Aug 06 03:27:34 grafana systemd[1]: grafana-server.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support

-- The unit grafana-server.service has entered the 'failed' state with result 'exit-code'.
Aug 06 03:27:34 grafana systemd[1]: Failed to start grafana-server.service - Grafana instance.
-- Subject: A start job for unit grafana-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support

-- A start job for unit grafana-server.service has finished with a failure.

-- The job identifier is 4522 and the job result is failed.
Aug 06 03:27:35 grafana systemd[1]: grafana-server.service: Start request repeated too quickly.
Aug 06 03:27:35 grafana systemd[1]: grafana-server.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support

-- The unit grafana-server.service has entered the 'failed' state with result 'exit-code'.
Aug 06 03:27:35 grafana systemd[1]: Failed to start grafana-server.service - Grafana instance.
-- Subject: A start job for unit grafana-server.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support

-- A start job for unit grafana-server.service has finished with a failure.

-- The job identifier is 4591 and the job result is failed.

root@grafana .../share/grafana# service start grafana-server
start: unrecognized service
root@grafana .../share/grafana# systemctl restart grafana-server.service
root@grafana .../share/grafana# systemctl restart grafana-server
Job for grafana-server.service failed because the control process exited with error code.
See "systemctl status grafana-server.service" and "journalctl -xeu grafana-server.service" for details.
root@grafana .../share/grafana# systemctl stop grafana-server.service
root@grafana .../share/grafana# systemctl status grafana-server.service
x grafana-server.service - Grafana instance
Loaded: loaded (/lib/systemd/system/grafana-server.service; disabled; preset: enabled)
Active: failed (Result: exit-code) since Tue 2024-08-06 03:28:43 UTC; 51s ago
Duration: 2ms
Docs: http://docs.grafana.org
Process: 6211 ExecStart=/usr/share/grafana/bin/grafana server --config=${CONF_FILE} --pidfile=${PID_FILE_DIR}/grafana-server.pid --packaging=deb cfg:default>
Main PID: 6211 (code=exited, status=226/NAMESPACE)
CPU: 2ms

Aug 06 03:28:43 grafana systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.
Aug 06 03:28:43 grafana systemd[1]: Stopped grafana-server.service - Grafana instance.
Aug 06 03:28:43 grafana systemd[1]: grafana-server.service: Start request repeated too quickly.
Aug 06 03:28:43 grafana systemd[1]: grafana-server.service: Failed with result 'exit-code'.
Aug 06 03:28:43 grafana systemd[1]: Failed to start grafana-server.service - Grafana instance.
Aug 06 03:28:44 grafana systemd[1]: grafana-server.service: Start request repeated too quickly.
Aug 06 03:28:44 grafana systemd[1]: grafana-server.service: Failed with result 'exit-code'.
Aug 06 03:28:44 grafana systemd[1]: Failed to start grafana-server.service - Grafana instance.

root@grafana .../share/grafana# systemctl status grafana-server
x grafana-server.service - Grafana instance
Loaded: loaded (/lib/systemd/system/grafana-server.service; disabled; preset: enabled)
Active: failed (Result: exit-code) since Tue 2024-08-06 03:28:43 UTC; 1min 3s ago
Duration: 2ms
Docs: http://docs.grafana.org
Process: 6211 ExecStart=/usr/share/grafana/bin/grafana server --config=${CONF_FILE} --pidfile=${PID_FILE_DIR}/grafana-server.pid --packaging=deb cfg:default>
Main PID: 6211 (code=exited, status=226/NAMESPACE)
CPU: 2ms

Aug 06 03:28:43 grafana systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.
Aug 06 03:28:43 grafana systemd[1]: Stopped grafana-server.service - Grafana instance.
Aug 06 03:28:43 grafana systemd[1]: grafana-server.service: Start request repeated too quickly.
Aug 06 03:28:43 grafana systemd[1]: grafana-server.service: Failed with result 'exit-code'.
Aug 06 03:28:43 grafana systemd[1]: Failed to start grafana-server.service - Grafana instance.
Aug 06 03:28:44 grafana systemd[1]: grafana-server.service: Start request repeated too quickly.
Aug 06 03:28:44 grafana systemd[1]: grafana-server.service: Failed with result 'exit-code'.
Aug 06 03:28:44 grafana systemd[1]: Failed to start grafana-server.service - Grafana instance.
lines 1-17/17 (END)
root@grafana .../share/grafana# systemctl start grafana-server
root@grafana .../share/grafana# systemctl status grafana-server
x grafana-server.service - Grafana instance
Loaded: loaded (/lib/systemd/system/grafana-server.service; disabled; preset: enabled)
Active: failed (Result: exit-code) since Tue 2024-08-06 03:29:56 UTC; 7s ago
Duration: 3ms
Docs: http://docs.grafana.org
Process: 6236 ExecStart=/usr/share/grafana/bin/grafana server --config=${CONF_FILE} --pidfile=${PID_FILE_DIR}/grafana-server.pid --packaging=deb cfg:default>
Main PID: 6236 (code=exited, status=226/NAMESPACE)
CPU: 2ms

Aug 06 03:29:56 grafana systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.
Aug 06 03:29:56 grafana systemd[1]: Stopped grafana-server.service - Grafana instance.
Aug 06 03:29:56 grafana systemd[1]: grafana-server.service: Start request repeated too quickly.
Aug 06 03:29:56 grafana systemd[1]: grafana-server.service: Failed with result 'exit-code'.
Aug 06 03:29:56 grafana systemd[1]: Failed to start grafana-server.service - Grafana instance.

root@grafana .../share/grafana# ^C
root@grafana .../share/grafana# ^C
root@grafana .../share/grafana# ^C
root@grafana .../share/grafana# ^C
root@grafana .../share/grafana# ^C
root@grafana .../share/grafana# ^C

TO RUN I HAvE TO:

root@grafana .../share/grafana# su -s /bin/bash grafana
grafana@grafana:$ ./usr/sbin/grafana-server --homepath=/usr/share/grafana --config=/etc/grafana/grafana.ini
bash: ./usr/sbin/grafana-server: No such file or directory
grafana@grafana:
$ /usr/sbin/grafana-server --homepath=/usr/share/grafana --config=/etc/grafana/grafana.ini
INFO [08-06|03:32:15] Starting Grafana logger=settings version=11.1.3 commit=beac3bdbcb34e68b53538cac5734ef90344d3122 branch=HEAD compiled=2024-08-06T03:32:15Z
INFO [08-06|03:32:15] Config loaded from logger=settings file=/usr/share/grafana/conf/defaults.ini
INFO [08-06|03:32:15] Config loaded from logger=settings file=/etc/grafana/grafana.ini
INFO [08-06|03:32:15] Target logger=settings target=[all]
INFO [08-06|03:32:15] Path Home logger=settings path=/usr/share/grafana
INFO [08-06|03:32:15] Path Data logger=settings path=/usr/share/grafana/data
INFO [08-06|03:32:15] Path Logs logger=settings path=/usr/share/grafana/data/log
INFO [08-06|03:32:15] Path Plugins logger=settings path=/usr/share/grafana/data/plugins
INFO [08-06|03:32:15] Path Provisioning logger=settings path=/usr/share/grafana/conf/provisioning
INFO [08-06|03:32:15] App mode production logger=settings
INFO [08-06|03:32:15] FeatureToggles logger=featuremgmt dashgpt=true logRowsPopoverMenu=true logsExploreTableVisualisation=true recordedQueriesMulti=true alertingInsights=true influxdbBackendMigration=true betterPageScrolling=true angularDeprecationUI=true exploreMetrics=true logsInfiniteScrolling=true lokiMetricDataplane=true prometheusAzureOverrideAudience=true dataplaneFrontendFallback=true awsAsyncQueryCaching=true alertingSimplifiedRouting=true lokiQueryHints=true topnav=true lokiQuerySplitting=true lokiStructuredMetadata=true ssoSettingsApi=true managedPluginsInstall=true awsDatasourcesNewFormStyling=true prometheusMetricEncyclopedia=true nestedFolders=true prometheusConfigOverhaulAuth=true recoveryThreshold=true publicDashboards=true cloudWatchCrossAccountQuerying=true logsContextDatasourceUi=true prometheusDataplane=true annotationPermissionUpdate=true panelMonitoring=true exploreContentOutline=true transformationsRedesign=true cloudWatchNewLabelParsing=true kubernetesPlaylists=true correlations=true alertingNoDataErrorExecution=true
INFO [08-06|03:32:15] Connecting to DB logger=sqlstore dbtype=sqlite3
INFO [08-06|03:32:15] Locking database logger=migrator
INFO [08-06|03:32:15] Starting DB migrations logger=migrator
INFO [08-06|03:32:15] migrations completed logger=migrator performed=0 skipped=572 duration=1.391011ms
INFO [08-06|03:32:15] Unlocking database logger=migrator
INFO [08-06|03:32:15] Envelope encryption state logger=secrets enabled=true current provider=secretKey.v1
ERROR[08-06|03:32:15] Failed to get renderer plugin sources logger=renderer.manager error="failed to open plugins path"
INFO [08-06|03:32:15] Restored cache from database logger=plugin.angulardetectorsprovider.dynamic duration=976.72µs
INFO [08-06|03:32:15] Loading plugins... logger=plugin.store
ERROR[08-06|03:32:15] Failed to load external plugins logger=plugin.sources error="failed to open plugins path"
ERROR[08-06|03:32:15] Could not register plugin logger=plugins.registration pluginId=xychart error="plugin xychart is already registered"
ERROR[08-06|03:32:15] Could not initialize plugin logger=plugins.initialization pluginId=xychart error="plugin xychart is already registered"
INFO [08-06|03:32:15] Plugins loaded logger=plugin.store count=54 duration=62.329338ms
INFO [08-06|03:32:15] Query Service initialization logger=query_data
INFO [08-06|03:32:15] Live Push Gateway initialization logger=live.push_http
INFO [08-06|03:32:15] Applying new configuration to Alertmanager logger=ngalert.notifier.alertmanager org=1 configHash=d2c56faca6af2a5772ff4253222f7386
INFO [08-06|03:32:15] Running in alternative execution of Error/NoData mode logger=ngalert.state.manager
INFO [08-06|03:32:15] registering usage stat providers logger=infra.usagestats.collector usageStatsProvidersLen=2
INFO [08-06|03:32:15] starting to provision alerting logger=provisioning.alerting
INFO [08-06|03:32:15] finished to provision alerting logger=provisioning.alerting
ERROR[08-06|03:32:15] Failed to get renderer plugin sources logger=renderer.manager error="failed to open plugins path"
INFO [08-06|03:32:15] Storage starting logger=grafanaStorageLogger
INFO [08-06|03:32:15] Warming state cache for startup logger=ngalert.state.manager
INFO [08-06|03:32:15] HTTP Server Listen logger=http.server address=[::]:3000 protocol=http subUrl= socket=
INFO [08-06|03:32:15] Starting MultiOrg Alertmanager logger=ngalert.multiorg.alertmanager
INFO [08-06|03:32:15] State cache has been initialized logger=ngalert.state.manager states=0 duration=43.469988ms
INFO [08-06|03:32:15] Starting scheduler logger=ngalert.scheduler tickInterval=10s maxAttempts=1
INFO [08-06|03:32:15] starting logger=ticker first_tick=2024-08-06T03:32:20Z
INFO [08-06|03:32:15] starting to provision dashboards logger=provisioning.dashboard
INFO [08-06|03:32:15] finished to provision dashboards logger=provisioning.dashboard
INFO [08-06|03:32:15] Update check succeeded logger=plugins.update.checker duration=210.175511ms
INFO [08-06|03:32:15] Update check succeeded logger=grafana.update.checker duration=210.209889ms
INFO [08-06|03:32:16] Adding GroupVersion playlist.grafana.app v0alpha1 to ResourceManager logger=grafana-apiserver
INFO [08-06|03:32:16] Adding GroupVersion featuretoggle.grafana.app v0alpha1 to ResourceManager logger=grafana-apiserver
^CINFO [08-06|03:32:16] Shutdown started logger=server reason="System signal: interrupt"
INFO [08-06|03:32:16] stopped logger=ticker last_tick=2024-08-06T03:32:10Z
INFO [08-06|03:32:16] StorageObjectCountTracker pruner is exiting logger=grafana-apiserver
INFO [08-06|03:32:16] Closing tracing logger=tracing

@marcos-mendez
Copy link
Member Author

After executing:

chown -R grafana:grafana /usr/share/grafana
chown -R grafana:grafana /etc/grafana
chmod -R 755 /usr/share/grafana
chmod -R 755 /etc/grafana

Everything starts to work again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant