与所有音乐流媒体服务一样,Spotify 相对于本地保存文件的最大劣势是需要持续访问互联网。虽然您可以下载歌曲以供离线播放,但您不能对每首歌曲都执行此操作。如果Spotify 一直暂停(Spotify keeps pausing),或者您看到 Spotify 出现“错误代码 4”,则表明存在互联网问题。
Spotify“错误代码 4”仅在Spotify桌面客户端无法检测到有效的互联网连接时出现。发生这种情况的原因有很多,从物理上断开的连接到不正确的 DNS 设置(incorrect DNS settings)。如果您遇到此问题并且想要解决它,那么您需要执行以下操作。
是什么导致 Spotify 错误代码 4?(What Causes Spotify Error Code 4?)
Spotify“错误代码 4”消息是阻止Spotify桌面客户端连接到其服务器的问题。在没有连接的情况下,您必须先将文件下载到您的 PC 才能流式传输音乐。
此类连接(Connection)问题可能是由于与您的本地网络的WiFi或以太网连接(Ethernet connection)断开,或者您的 Internet 服务器提供商的中断造成的。它还可能指向域名服务器 ( DNS ) 问题,有时可以通过清除DNS缓存或切换DNS提供商来解决此问题。
Spotify使用TCP端口 4070 连接到其桌面应用程序中的服务器,但如果失败,则应默认返回常见的 Web 端口 443 和 80。端口 443 和 80 不太可能被任何本地网络防火墙或Windows 防火墙(Windows Firewall)阻止,因为这会阻止所有 Internet 访问。
但是,这不能保证。虽然如果端口 4070 被阻止, Spotify应该使用网络端口,但这仍然可能导致连接问题。您可能需要检查打开的端口(check for open ports),如果端口 4070 被阻止,请使用Windows 防火墙(Windows Firewall)或网络防火墙打开它。
您可能还会发现公司防火墙正在阻止Spotify使用的特定 IP 范围或域名。如果Spotify和其他外部服务被学校或工作场所的防火墙阻止,您需要与相关网络管理员联系以解决问题,或考虑绕过它的替代方案(consider alternatives to bypass it)。
检查您的网络和 Internet 连接(Checking Your Network and Internet Connections)
在更改任何设置之前,请确认您与本地网络的连接(以及您的网络和互联网提供商之间的连接)正常。您可以通过在Windows 10(Windows 10)的任务栏中查找网络符号来快速检查您是否使用WiFi或以太网(Ethernet)连接到本地网络。
如果您没有可用的连接,则该符号将显示为一个角落带有十字的地球。
遇到同样问题的Mac(Mac)用户可以选择菜单栏右上角的网络符号。从这里,他们可以仔细检查其WiFi或以太网(Ethernet)连接的状态。
假设与本地网络的连接正常,您可能需要调查您的互联网连接。如果您不确定,请打开浏览器并尝试访问您喜欢的一些网站。如果这些无法加载,则可能表明存在连接问题(points to a connection issue),您需要进一步调查。
如果 Internet 连接中断,您需要联系您的 Internet 服务提供商 ( ISP ) 以获得更多支持。或者,您可以使用智能手机的移动数据连接切换到移动热点,以快速恢复在线,注意避免超出数据上限或网络共享限制。
如果您使用虚拟专用网络 (VPN)(virtual private network (VPN))连接到 Internet,这也可能导致DNS冲突或连接问题。Spotify通常应该通过标准VPN连接工作,但如果您不确定,请先断开连接并使用标准连接进行测试和故障排除。
正如我们所提到的,如果端口 4070 被阻止,Spotify应该默认使用端口 443 和 80 建立连接,但情况并非总是如此。如果您认为您的网络或系统防火墙阻止了此端口,则需要调整 Windows 防火墙规则(adjust your Windows Firewall rules)或路由器自己的防火墙设置以允许它。
重置 DNS 缓存(Resetting DNS Cache)
域名(Domain)服务器对于更广泛的互联网至关重要。如果没有DNS,在浏览器中输入helpdeskgeek.com将不会产生任何结果,因为您的浏览器无法将您指向正确的 Web 服务器的 IP 地址。
像Spotify这样的服务也依赖DNS系统来允许他们使用域名快速更改服务器(或分散服务器负载)。如果存在DNS问题,这可能会阻止Spotify工作。在更改DNS服务器之前,您可以清除 DNS 缓存(clear the DNS cache)并重新生成它。
- 要清除Windows上的(Windows)DNS缓存,请打开一个新的PowerShell窗口。您可以通过右键单击开始(Start)菜单并选择Windows PowerShell (Admin)来执行此操作。
- 在PowerShell窗口中,键入ipconfig /flushdns并选择Enter键。
- 在Mac上,您可以通过从(Mac)Launchpad(在“其他(Other)”文件夹中可见)打开一个新的终端(Terminal)窗口来清除DNS 。在终端(Terminal)窗口中,键入sudo dscacheutil -flushcache;(sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder)sudo killall -HUP mDNSResponder,然后选择Enter。
更改 DNS 设置(Changing DNS Settings)
如果DNS问题导致Spotify停止工作,您可以将 DNS 服务器更改(change your DNS server )为公共提供商。您可以从Google和OpenDNS等组织使用许多免费的公共 DNS 服务器(free public DNS servers)。
- 要更改Windows上的(Windows)DNS服务器,请右键单击“开始(Start)”菜单并选择“设置”(Settings)。
- 在设置(Settings)菜单中,选择网络和 Internet(Network & Internet) >Status > Properties。
- 在“属性(Properties)”菜单中,向下滚动到“ IP 设置”(IP Settings)部分,然后选择“编辑(Edit)”选项。
- 将Edit IP Settings(Edit IP Settings)选项更改为Manual,然后将IPv4滑块选择到On位置。在首选 DNS(Preferred DNS )和备用 DNS(Alternate DNS)框中,输入合适的公共DNS提供商(例如Google DNS 的8.8.8.8和8.8.4.4),然后选择保存(Save)以保存您的设置。
- 在Mac上,您可以在系统偏好设置(System Preferences)菜单中更改DNS设置。(DNS)选择Apple menu > System Preferences来启动它。
- 在系统偏好设置(System Preferences)中,选择网络(Network)。在“网络(Network)”菜单中,选择您的连接,然后选择“高级(Advanced)”选项。
- 选择DNS选项卡,然后选择添加(Add)图标以添加公共DNS提供商。添加后,选择“确定(OK)”进行保存。
更改DNS设置后,使用上述步骤清除DNS缓存或重新启动 PC 或(DNS)Mac。
切换播放器或重新安装 Spotify(Switch Players or Reinstall Spotify)
如果上述步骤仍然无法解决问题,您可以尝试通过切换到网络播放器或Spotify移动应用程序来修复它。
正如我们所提到的,Spotify使用端口 4070 连接到其服务器。如果这被阻止并且您似乎无法让Spotify桌面客户端正常工作,请(Spotify)使用此 URL(Spotify web player using this URL)切换到Spotify 网络播放器,以确保它仅使用HTTP(端口 443 和 80)进行连接。但是,这仅在您的互联网连接正常时才有效。
或者,您可以重新安装Spotify桌面应用程序。您需要先卸载它(uninstall it first),确保在此过程中删除所有损坏的文件。从您的 PC 或Mac中删除Spotify后,您可以从Spotify网站下载最新版本。(download the latest version)
享受 Spotify(Enjoying Spotify)
解决Spotify“错误代码 4”问题通常很简单,但如果您仍然遇到问题,则可能表明您的互联网连接存在更广泛的问题。但是,一旦Spotify启动并运行,您就可以完全访问数百万首歌曲和艺术家,尤其是一些鲜为人知(lesser known tips and tricks)的技巧和窍门。
您可能需要考虑升级到 Spotify Premium(upgrading to Spotify Premium)以放弃广告或为您的家人使用适合儿童的 Spotify Kids(use the child-friendly Spotify Kids)替代品。只要Spotify 正在播放歌曲(Spotify is playing songs),您就可以坐下来、放松并享受音乐,但不要忘记,如果不适合您的音乐品味,您可以尝试多种 Spotify 替代方案。(several Spotify alternatives)
How to Fix Spotify Error Code 4
Like all music streaming servіces, Spotify’s biggest disadvantage over locally-saved files is a requirement for constant internet access. While you can download songs for оffline playback, you cаn’t do this fоr еvery song. Іf Spotify keeps pausing, or you see Spotify “error code 4” appear, it points to an internet issue.
Spotify “error code 4” only appears when the Spotify desktop client can’t detect a working internet connection. There are all kinds of reasons why this might occur, from a physically broken connection to incorrect DNS settings. If you’re faced with this problem and you’re looking to fix it, here’s what you’ll need to do.
What Causes Spotify Error Code 4?
A Spotify “error code 4” message is an issue that prevents the Spotify desktop client from connecting to its servers. Without a connection, you can’t stream music without having the files downloaded to your PC first.
Connection issues like this could be caused by a disconnected WiFi or Ethernet connection to your local network, or by an outage at your internet server provider. It could also point to a domain name server (DNS) issue, which can sometimes be fixed by clearing the DNS cache or switching DNS providers.
Spotify uses TCP port 4070 to connect to its servers in the desktop app, but should default back to common web ports 443 and 80 if it fails. Ports 443 and 80 are unlikely to be blocked by any local network firewall or by Windows Firewall as this would block all internet access.
However, this isn’t guaranteed. While Spotify should use web ports if port 4070 is blocked, this could still cause issues with connectivity. You may need to check for open ports and, if port 4070 is blocked, open it using Windows Firewall or your network firewall.
You may also find that a corporate firewall is blocking the particular IP range or domain names that Spotify uses. If Spotify and other outside services are being blocked by a school or workplace firewall, you’ll need to speak to a relevant network administrator to resolve the issue, or consider alternatives to bypass it.
Checking Your Network and Internet Connections
Before changing any settings, confirm that your connection to your local network (and the connection between your network and internet provider) is working. You can quickly check whether or not you’re connected to a local network using WiFi or Ethernet by looking for the network symbol in the taskbar on Windows 10.
If you don’t have a working connection, the symbol appears as a globe with a cross in the corner.
Mac users who face the same issue can select the network symbol in the top right corner of the menu bar. From here, they can double-check the status of their WiFi or Ethernet connection.
Assuming the connection to your local network is working, you may need to investigate your internet connection. If you’re unsure, open your browser and try to visit some of your favorite websites. If these fail to load, it likely points to a connection issue that you’ll need to investigate further.
Where an internet connection is broken, you’ll need to contact your internet service provider (ISP) for additional support. Alternatively, you can switch to a mobile hotspot using your smartphone’s mobile data connection to get yourself back online quickly, taking care to avoid breaching your data cap or tethering limits.
If you’re using a virtual private network (VPN) to connect to the internet, this could also cause DNS conflicts or connection issues. Spotify should usually work over a standard VPN connection, but if you’re unsure, disconnect and use your standard connection to test and troubleshoot first.
As we’ve mentioned, Spotify should default to ports 443 and 80 to make a connection if port 4070 is blocked, but this isn’t always the case. If you think your network or system firewall is blocking this port, you’ll need to adjust your Windows Firewall rules or your router’s own firewall settings to allow it.
Resetting DNS Cache
Domain name servers are essential to the wider internet. Without DNS, typing helpdeskgeek.com into your browser would result in nothing, as your browser wouldn’t be able to point you to the correct web server’s IP address.
Services like Spotify also rely on the DNS system to allow them to quickly change servers (or spread server load) using domain names. If there’s a DNS issue, this could stop Spotify from working. Before you change DNS servers, you can clear the DNS cache and regenerate it.
- To clear DNS cache on Windows, open a new PowerShell window. You can do this by right-clicking the Start menu and selecting Windows PowerShell (Admin).
- In the PowerShell window, type ipconfig /flushdns and select the Enter key.
- On a Mac, you can clear DNS by opening a new Terminal window from the Launchpad (visible in the Other folder). In the Terminal window, type sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder, then select Enter.
Changing DNS Settings
If a DNS issue is causing Spotify to stop working, you can change your DNS server to a public provider. There are a number of free public DNS servers you can use from organizations like Google and OpenDNS.
- To change DNS servers on Windows, right-click the Start menu and select Settings.
- In the Settings menu, select Network & Internet > Status > Properties.
- In the Properties menu, scroll down to the IP Settings section, then select the Edit option.
- Change the Edit IP Settings option to Manual, then select the IPv4 slider to the On position. In the Preferred DNS and Alternate DNS boxes, type in a suitable public DNS provider (eg. 8.8.8.8 and 8.8.4.4 for Google DNS), then select Save to save your settings.
- On Mac, you can change DNS settings in the System Preferences menu. Select the Apple menu > System Preferences to launch this.
- In System Preferences, select Network. In the Network menu, select your connection, then select the Advanced option.
- Select the DNS tab, then select the Add icon to add a public DNS provider. Once you’ve added it, select OK to save.
Once you’ve changed your DNS settings, clear the DNS cache using the steps above or restart your PC or Mac.
Switch Players or Reinstall Spotify
If the steps above still don’t resolve the issue, you can try to fix it by switching to the web player or to the Spotify mobile apps.
As we’ve mentioned, Spotify uses port 4070 to connect to its servers. If this is blocked and you can’t seem to get the Spotify desktop client working, switch to the Spotify web player using this URL to ensure it only uses HTTP (ports 443 and 80) to connect. This will only work if your internet connection is working, however.
Alternatively, you can reinstall the Spotify desktop app. You’ll need to uninstall it first, ensuring any corrupted files are removed in the process. Once Spotify is removed from your PC or Mac, you can download the latest version from the Spotify website.
Enjoying Spotify
Troubleshooting a Spotify “error code 4” issue is usually straightforward, but if you’re still having issues, it likely points to wider problems with your internet connection. Once Spotify is up and running, however, you can enjoy full access to millions of songs and artists, especially with some lesser known tips and tricks up your sleeve.
You may want to consider upgrading to Spotify Premium to ditch the ads or use the child-friendly Spotify Kids alternative for your family. As long as Spotify is playing songs, you can sit, relax, and enjoy the music, but don’t forget, there are several Spotify alternatives you can try if it doesn’t suit your music tastes.