CSV Plugin: Permission Denied

Greetings All:

As a beginner user, I have been struggling with a problem for a while now, so I figured it was high time to enlist the collective minds of everyone here on the forum:

I have the CSV Plugin from Grafana Labs installed on my Raspberry Pi 4 model B, however, whenever I try to load a file (whether that’s csv or just plain .txt) as a data source. I get an error message saying "stat . . ./test1: permission denied." Test1 is the file name. I am trying to load the file locally (not with http). Occasionally, I would get another error message: Not able to add datasource: error=“UNIQUE constraint failed: data_source.org_id, data_source.uid.” Regardless of which error message I get, I still am unable to load the datasource and proceed.

I’ve looked at the logs, and they don’t provide much information beyond what has already been written here. I changed file and folder permissions around with no success, and changed defualts.ini to enable local mode. I’ve also looked at grafana, and the csv plugin’s, github, but can’t identify where the unique constraints are. At this point, I have three theories, but I don’t know how to proceed or troubleshoot them. If anyone has any solutions or better ideas, please do let me know. My theories are:

1) Unique constraint failed: the error message mentions that a unique constraint failed. I poked around on the forums and people here mentioned before that the constraints may need to be manually overwritten or deleted. Unfortunately I don’t know where these constraints or error files are located.

2) Inspect the database for errors: I may be able to open the database to inspect the query and/or overwrite the constraints that are failing, but I don’t think I’m using a database right now (since I am running this all locally on the pi).

3) User conflict/permissions: I’m not sure if a user running grafana can load files created by another user, but in this case, I believe they’re the same user. Regardless. there might still be an issue with some user permissions that I am not aware of.

If anyone has helpful suggestions/solutions on what to do, please let me know. I’d love nothing more than to have this issue resolved. If anyone needs any more information, please let me know, I’d be happy to provide them.

Here is the log file. Interestingly, there doesn’t seem to be an error message even though the server said permission denied:

I will update my post shortly with log files and screenshots. Updated

Welcome

Please provide the following
version of grafana
where the file is located in relation to grafana: exact folder path

Hi @yosiasz :slight_smile:

my version of grafana is 10.0.3, and the exact folder path is: /home/pearl <–(this is the name of the pi device)/Desktop/test1

1 Like

@yosiasz any luck? Does anyone have any ideas/solutions? I’m running this on the pi (linux os).

I looked at the .ini files to see if there is any config I can add that will override the permission denied error. But without knowing what is causing the issue it is hard to solve.

sorry got burried. Take a look at this setting if you have not already?

[plugin.marcusolsson-csv-datasource]
allow_local_mode = true

I have the same problem. I’ve added allow local mode, but still have the same issue

What does the path to csv look like?

The file path: /home/user/Documents/Scripts/data.csv

create a folder named grafana_data in your C drive then copy your data.csv into that folder and point grafana to that location and see if that works.
/home/user/Documents/Scripts/ might be a special folder with stricter permissions.

It works, thanks

1 Like