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

Cannot create session: Connection refused (os error 111) (v0.3.5) #1322

Closed
duwutape opened this issue Jan 2, 2025 · 2 comments
Closed

Cannot create session: Connection refused (os error 111) (v0.3.5) #1322

duwutape opened this issue Jan 2, 2025 · 2 comments
Labels
bug A functionality or parts of a program that do not work as intended

Comments

@duwutape
Copy link

duwutape commented Jan 2, 2025

Description
Failed to connect to spotify: Cannot create session: Connection refused (os error 111)
Like in #1161 suggested I tried telnet ap.spotify.com 433 and could connect to it.

To Reproduce

  1. install spotifyd using yay -S spotifyd
  2. mkdir ~/.config/spotifyd
  3. created spotifyd.conf
  4. spotifyd --config-path ~/.config/spotifyd/spotifyd.conf
  5. spotifyd --verbose --no-daemon

Expected behavior
Spotifyd created a sesseion

Logs

Click to show logs
Loading config from "/home/raven/.config/spotifyd/spotifyd.conf"
CliConfig { config_path: None, no_daemon: true, verbose: true, pid: None, shared_config: SharedConfigValues { username: Some("taken out for privacy"), username_cmd: None, password: Some("taken out for privacy"), password_cmd: Some("taken out for privacy"), use_keyring: true, use_mpris: Some(true), dbus_type: Some(Session), on_song_change_hook: Some("command_to_run_on_playback_events"), cache_path: Some("cache_directory"), no-audio-cache: true, backend: Some(Alsa), volume_controller: Some(Alsa), device: Some("alsa_audio_device"), control: Some("alsa_audio_device"), mixer: Some("PCM"), device_name: Some("raven"), bitrate: Some(Bitrate160), audio_format: Some(S16), initial_volume: Some("90"), volume_normalisation: true, normalisation_pregain: Some(-10.0), zeroconf_port: Some(1234), proxy: Some("http://localhost:8888/callback"), device_type: Some(Speaker), autoplay: true, max_cache_size: Some(1000000000) } }
Found user shell: Some("/usr/bin/zsh")
registering event source with poller: token=Token(2147483649), interests=READABLE
Using alsa volume controller.
Keyring is ignored, since you already configured a password
registering event source with poller: token=Token(0), interests=READABLE | WRITABLE
deregistering event source from poller
registering event source with poller: token=Token(16777216), interests=READABLE | WRITABLE
deregistering event source from poller
Failed to resolve Access Point: error trying to connect: tcp connect error: Connection refused (os error 111)
Using fallback "ap.spotify.com:443"
Connecting to AP "ap.spotify.com:443"
Using proxy "http://localhost:8888/callback"
registering event source with poller: token=Token(33554432), interests=READABLE | WRITABLE
deregistering event source from poller
failed to connect to spotify: Cannot create session: Connection refused (os error 111)

Compilation flags
Installed spotifyd from the AUR

Versions (please complete the following information):

  • OS: Manjaro Linux 6.11.11-1
  • Spotifyd: 0.3.5-1
  • cargo: 1.83.0

My Config

Click to show config
[global]
# Your Spotify account name.
username = [username]

# Your Spotify account password.
password = [password]

# A command that gets executed and can be used to
# retrieve your password.
# The command should return the password on stdout.
#
# This is an alternative to the `password` field. Both
# can't be used simultaneously.
password_cmd = "command_that_writes_password_to_stdout"

# If set to true, `spotifyd` tries to look up your
# password in the system's password storage.
#
# Note, that the `password` field will take precedence, if set.
use_keyring = true

# If set to true, `spotifyd` tries to bind to dbus (default is the session bus)
# and expose MPRIS controls. When running headless, without the session bus,
# you should set this to false, to avoid errors. If you still want to use MPRIS,
# have a look at the `dbus_type` option.
use_mpris = true

# The bus to bind to with the MPRIS interface.
# Possible values: "session", "system"
# The system bus can be used if no graphical session is available
# (e.g. on headless systems) but you still want to be able to use MPRIS.
# NOTE: You might need to add appropriate policies to allow spotifyd to
# own the name.
dbus_type = "session"

# The audio backend used to play music. To get
# a list of possible backends, run `spotifyd --help`.
backend = "alsa" # use portaudio for BSD and macOS [homebrew]

# The alsa audio device to stream audio. To get a
# list of valid devices, run `aplay -L`,
device = "alsa_audio_device"  # omit for macOS

# The PCM sample format to use. Possible values
# are F32, S32, S24, S24_3, S16.
# Change this value if you encounter errors like
# "Alsa error PCM open ALSA function 'snd_pcm_hw_params_set_format' failed with error 'EINVAL: Invalid argument'"
audio_format = "S16"

# The alsa control device. By default this is the same
# name as the `device` field.
control = "alsa_audio_device"  # omit for macOS

# The alsa mixer used by `spotifyd`.
mixer = "PCM"  # omit for macOS

# The volume controller. Each one behaves different to
# volume increases. For possible values, run
# `spotifyd --help`.
volume_controller = "alsa"  # use softvol for BSD and macOS

# A command that gets executed in your shell after each song changes.
on_song_change_hook = "command_to_run_on_playback_events"

# The name that gets displayed under the connect tab on
# official clients.
device_name = "raven"

# The audio bitrate. 96, 160 or 320 kbit/s
bitrate = 160

# The directory used to cache audio data. This setting can save
# a lot of bandwidth when activated, as it will avoid re-downloading
# audio files when replaying them.
#
# Note: The file path does not get expanded. Environment variables and
# shell placeholders like $HOME or ~ don't work!
cache_path = "cache_directory"

# The maximal size of the cache directory in bytes
# The example value corresponds to ~ 1GB
max_cache_size = 1000000000

# If set to true, audio data does NOT get cached.
no_audio_cache = true

# Volume on startup between 0 and 100
# NOTE: This variable's type will change in v0.4, to a number (instead of string)
initial_volume = "90"

# If set to true, enables volume normalisation between songs.
volume_normalisation = true

# The normalisation pregain that is applied for each song.
normalisation_pregain = -10

# After the music playback has ended, start playing similar songs based on the previous tracks.
autoplay = true

# The port at which `spotifyd` is going to offer its service over the network (TCP).
# If not set, a random port > 1024 is used. For the service to be discoverable on the
# local network via mDNS, both the mDNS port (5353 UDP) and the random or fixed
# zeroconf port need to be allowed through any active firewall.
zeroconf_port = 1234

# The proxy `spotifyd` will use to connect to spotify.
proxy = "http://localhost:8888/callback"

# The displayed device type in Spotify clients.
# Can be unknown, computer, tablet, smartphone, speaker, t_v,
# a_v_r (Audio/Video Receiver), s_t_b (Set-Top Box), audio_dongle,
# game_console, cast_audio, cast_video, automobile, smartwatch, chromebook,
# unknown_spotify, car_thing, observer and home_thing.
device_type = "speaker"
@duwutape duwutape added the bug A functionality or parts of a program that do not work as intended label Jan 2, 2025
@eladyn
Copy link
Member

eladyn commented Jan 2, 2025

As logged in the line Using proxy "http://localhost:8888/callback", spotifyd tries to use a proxy for its connection, since that is specified in the config file. You should probably comment / remove any lines there that you don't need like the proxy one.

@duwutape
Copy link
Author

duwutape commented Jan 2, 2025

Thanks, I don't get this error anymore but the bad credentials one like in #1293

@duwutape duwutape closed this as completed Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A functionality or parts of a program that do not work as intended
Projects
None yet
Development

No branches or pull requests

2 participants