Jump to content

Safari can not connect to server "localhost:web/index.html"


sondon
Go to solution Solved by sondon,

Recommended Posts

Can not browse library or configure Emby. Safari says it can not establish connection to server because it can not open localhost , Chrome browser says connection has been refused by localhost. Can not find any log files. Please help.

MacOS 11.2 , reboot of Mac and reinstallation of EmbyServer does not help.

Link to comment
Share on other sites

sorry it's of course localhost:8096/web/index.html#!/dashboard . That's what Emby is trying to connect on the Mac when selecting e.g. "Browse Library" or "Configure Emby".

Get same error message from Safari resp. Chrome with localhost:8096 or 127.0.0.1:8096 . There are more entries on that topic, I have seen them all but no success.

Emby is running on same Mac. emby app on iPad does not find emby server running on the Mac either. Something is blocking connection to emby. I have been using emby for 3 month with same setup and without any problems. All worked well until suddenly some days ago, no updates on Mac or iPad in that timeframe. No changes on the system. All I did was to exit emby server because I wanted to eject the external hard drive emby server is accessing. I re-booted the Mac, started emby server, selected "Configure Emby" and got the message that Safari can not connect to localhost:8096/web/index.html#!/dashboard .

Update: generated a list of open localhost ports while emby server is running by command: sudo lsof | grep localhost

Result: no port 8096 there , but this one: "embytray ...... TCP localhost:8024 (LISTEN)". localhost:8024 results to "404 page not found" in Safari

"embytray ...... TCP localhost:8024 (LISTEN)" is not there when emby server is not running

Edited by sondon
Link to comment
Share on other sites

Good question. I am 100% sure that Emby Server is started... but is it running indeed ... or stuck somewhere in between? After double clicking the Server app icon, the Emby icon appears in the menu bar. There I can select  e.g. "Browse Library" or "Configure Emby" and the error message pops up.

After reboot of the Mac, I can reproduce that when I start the app and select e.g. "Browse Library" within a second or so, I get a message something like "Emby Server is starting, please try again soon". Sounds good, but when I try again a few seconds later I get the error message. But only after reboot. When I exit Emby Server and start it again, I get the error message instantly.

Edited by sondon
Link to comment
Share on other sites

Happy2Play

Okay you have a corrupt database possibly.

SQLitePCL.pretty.SQLiteException: Corrupt: database disk image is malformed

Ensuring Emby is shutdown, you will need to go /Users/rs/.config/emby-server/data and look for library.db-shm and library.db-wal.  If they are present delete them and try to launch Emby again and see if it works.  If they are not present you will need rename/backup or delete the library.db.  

Note those two files should only exist with the database is open.  If you have to delete the library.db you will loose all userdata, that is why I suggest renaming or backup old database. 

Link to comment
Share on other sites

Deleting library.db-shm and library.db-wal does not solve the problem but renaming library.db works. Emby Server is running and I can access the interface and log in. Cool. 😀 A new library.db has been generated. But as expected the configured libraries are gone🙄. Do I have to set all up again? What about the renamed library.db and the files in ..../metadata/library ? Those files are rather big in total.

Edited by sondon
Link to comment
Share on other sites

Happy2Play
1 hour ago, sondon said:

But as expected the configured libraries are gone🙄. Do I have to set all up again?

No all you have to do is run a library scan, but all custom metadata/images will be lost if you did/do not save metadata and images with media.

Since you do not use the Server Configuration Backup plugin (premiere user plugin) your userdata only exists in the old database.

Depending on how old that database is there may be a way to merge the userdata table from old db to new db, but this depends on age of db do to column changes along the way.  But not knowing where the corruption is/was this may be a issue also.

  

1 hour ago, sondon said:

What about the renamed library.db and the files in ..../metadata/library ? Those files are rather big in total.

May want to hold on to the renamed db a little longer, but /metadata/library will be purged and repopulated with the rebuild of the database.

Edited by Happy2Play
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...