Help with config file permission - can't edit

Just recently found a few old Pi’s sitting around and wanted to try this out. After installing, I’ve tried to modify the config file, but I can’t open it due to permissions:
Failed to open file - Permission denied
Any help would be greatly appreciated

try with sudo nano mopidy.conf or change chmod 755 mopidy.conf and then open with sudo and texeditor

Like @Morta helpfully says, if you are trying to edit the service config file in /etc/mopidy/mopidy.conf then you need elevated privileges and sudo nano /etc/mopidy/mopidy.conf will let you do that. Lookup how to use the nano text editor if you haven’t used it before. Avoid changing the file permissions.

Thank you both for your input and your time. I’ll try that out shortly after I check out some nano how-to’s first.
All the best!

Okay, so now I’ve tried to install Mopidy on a new fresh image and new Pi4. Clearly I’m a bit of a noob, but really want to get this to work. I’ve tried a number of times now over the last couple of weeks and had absolutely no success. I have a Pirate Audio hat on the way and would really like to figure out where the heck I’m going wrong. User error, for sure.

I’ve followed the guide but now have two problems;

    • Can’t locate the config file. Here’s what I get when I try sudo nano /etc

For information about configuration values that can be set in this file see:

Configuration — Mopidy 3.1.1 documentation

Run sudo mopidyctl config to see the current effective config, based on

both defaults and this configuration file.

mopidyctl config shows:
Running “/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config” as user mopidy
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000
restore_state = false
and goes on, but I can’t edit anything with sudo nano

  1. WHen I run mopidy config here’s what I get:
    WARNING 2021-01-15 08:05:47,100 [9434:MainThread] mopidy.config
    Ignoring config section ‘local’ because no matching extension was found
    [core]
    cache_dir = $XDG_CACHE_DIR/mopidy
    config_dir = $XDG_CONFIG_DIR/mopidy
    data_dir = $XDG_DATA_DIR/mopidy
    max_tracklist_length = 10000
    restore_state = false

I’m at a loss at this point. Can you help the helpless? haha

Let’s start from the top. Take a look at Running — Mopidy 3.1.1 documentation

You’ll see it describes two ways to run Mopidy, each of which uses a different config file. In your above messages you are mixing those ways. Which way do you want to run Mopidy?

Thanks for the reply. I should have mentioned I want to run it as a service.

OK. So do not run mopidy config as that’s not relevant for the service. Run sudo mopidyctl config.

To edit the config you need to edit the file at /etc/mopidy/mopidy.conf. Run sudo nano /etc/mopidy/mopidy.conf, make only the specific changes you require (the defaults are fine for most things), and save it with ctrl+x. When you then run sudo mopidyctl config it should reflect the changes you just made.

Thank you again for your time and reply.
When I run sudo nano /etc/mopidy/mopidy.conf, i get this:

For information about configuration values that can be set in this file see:

Configuration — Mopidy 3.1.1 documentation

Run sudo mopidyctl config to see the current effective config, based on

both defaults and this configuration file.

I don’t have anything to modify as there doesn’t appear to be a config file present.
Sorry for continuing to take up your time. I really appreciate the assistance!

I guess I’m a bit confused, what exactly is the problem here? You’ll see if you run sudo mopidyctl config all the current values – that will be a combination of the defaults plus any values you’ve overridden in the config file. So if you’ve not added anything to the config file it’ll just be the defaults. If any of those default values are not to your liking, you can change them by adding the preferred values to the config file. Hopefully this is explained at Configuration — Mopidy 3.1.1 documentation

Sorry, I’m trying to change the config file, but it won’t open or show anything after I run sudo nano /etc/mopidy/mopidy.conf. It doesn’t show anything that I can change, just where to look for the config file.
I just want to add my Spotify creds to the config file but there is nothing there for me to edit.
Tried editing the config in file manager but it gives me an error saying Access Denied.

pi@pi4:~ $ sudo mopidyctl config
Running “/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config” as user mopidy
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000
restore_state = false

[logging]
verbosity = 0
format = %(levelname)-8s [%(threadName)s] %(name)s %(message)s
color = false
config_file =

[audio]
mixer = software
mixer_volume =
output = autoaudiosink
buffer_time =

[proxy]
scheme =
hostname =
port =
username =
password =

[file]
enabled = true
media_dirs =
$XDG_MUSIC_DIR|Music
~/|Home
excluded_file_extensions =
.directory
.html
.jpeg
.jpg
.log
.nfo
.pdf
.png
.txt
.zip
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[http]
enabled = true
hostname = 127.0.0.1
port = 6680
zeroconf = Mopidy HTTP server on $hostname
allowed_origins =
csrf_protection = true
default_app = mopidy

[m3u]
enabled = true
base_dir =
default_encoding = latin-1
default_extension = .m3u8
playlists_dir =

[softwaremixer]
enabled = true

[stream]
enabled = true
protocols =
http
https
mms
rtmp
rtmps
rtsp
metadata_blacklist =
timeout = 5000

[mpd]
enabled = true
hostname = 127.0.0.1
port = 6600
password =
max_connections = 20
connection_timeout = 60
zeroconf = Mopidy MPD server on $hostname
command_blacklist =
listall
listallinfo
default_playlist_scheme = m3u

[spotify]
enabled = false ; Extension disabled due to config errors.
username = ; Must be set.
password = ; Must be set.
client_id = ; Must be set.
client_secret = ; Must be set.
bitrate = 160
volume_normalization = true
private_session = false
timeout = 10
allow_cache = true
allow_network = true
allow_playlists = true
search_album_count = 20
search_artist_count = 10
search_track_count = 50
toplist_countries =

This is almost as frustrating as dealing with me over and over! haha

If it’s not showing anything when opened in nano it’s very likely because it is empty. You must add the stuff you want to the file.

If you want to add a Spotify section, do that. Type it into the file when opened with nano. Or copy those parts from the output of sudo mopidyctl config, paste them into nano, make the changes you want.

Will do.

Thank you very much for your time!

Thank you for the assistance. I have a separate, but possibly related issue and will do a new post as it likely isn’t related to my initial post re: Permissions.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.