PostgreSQL Datasource Plugin Fails to Load with 404 Errors and Missing Build Script

Grafana Version: 11.5.2 (commit: NA, branch: main)

Issue Description:
I am unable to successfully install or use the PostgreSQL Datasource plugin (GitHub - shirish87/grafana-postgresql-datasource) in Grafana. The following errors are observed:

  1. Plugin Not Found (404 Errors):

    • Grafana logs repeatedly show 404 errors when attempting to load the plugin:
      logger=context t=2025-04-22T09:46:48.659190659+03:00 level=info msg="Request Completed" path=/core:plugin/grafana-postgresql-datasource.js status=404  
      
    • The error Could not find plugin definition for data source appears when configuring the datasource.
  2. Missing Build Script During Installation:

    • When attempting to build the plugin from source (cloned from GitHub), the command npm run build fails with:
      npm error Missing script: "build"  
      
    • The package.json file in the plugin repository does not include a build script.
  3. Network Connectivity Issues:

    • Grafana fails to download plugin manifests or dependencies (e.g., grafana-lokiexplore-app):
      error="Get \"https://grafana.com/api/plugins/grafana-lokiexplore-app/versions\": dial tcp: lookup grafana.com: no such host"  
      
    • This suggests DNS resolution or network connectivity issues.

Steps Taken:

  • Installed the plugin via grafana-cli plugins install grafana-postgresql-datasource.
  • Attempted manual installation from GitHub (cloned repository, ran npm install, but npm run build failed).
  • Verified plugin directory permissions (/var/lib/grafana/plugins).
  • Added allow_loading_unsigned_plugins = grafana-postgresql-datasource to grafana.ini.

Questions for Support:

  1. Is the PostgreSQL plugin compatible with Grafana v11.5.2?
  2. Are there specific steps to build the plugin if the build script is missing in package.json?

hi @vmuhanov the plugin you linked it is very old and definitely not compatible with the latest Grafana.

Grafana has inbuilt support for PostgreSQL you don’t need any plugin, just add a new datasource and select PostgreSQL.

@vmuhanov uninstall any kind of plugin you installed for postgresql. They are not necessary and they won’t work

Simply use the one inside grafana. Find documentation on how to use it here Configure the PostgreSQL data source | Grafana documentation

1 Like

Use Grafana’s built-in PostgreSQL plugin — no installation or external GitHub plugin needed.
It’s officially supported, secure, and works out of the box with Grafana v11.5.2.

I have built Grafana, the system works, but does not allow you to configure a connection to PostgreSQL, there is no form with configuration fields.
The same error appears as in the screenshot.
I have built the latest version and 11.6.1, the error remains.