ShaneIsrael / fireshare

Self host your media and share with unique links
GNU General Public License v3.0
653 stars 40 forks source link

Unknown errors when running on Mac OS 13.2.1 #197

Closed HillbillyZT closed 1 year ago

HillbillyZT commented 1 year ago

Describe the bug Upon configuring and launching new fireshare instance via docker-compose, and visiting the webpage, I am greeted with "Unknown Error" toast on the empty videos page. Attempting to login yields a toast "An unknown error occurred while trying to log in", and does not log in.

To Reproduce Steps to reproduce the behavior:

  1. configure docker-compose.yml
  2. docker-compose up -d
  3. navigate to localhost:8080 in Chrome
  4. See error

Expected behavior Visiting the webpage yields no error, and logging in works.

Screenshots An unknown error occurred while trying to log in

Screenshot 2023-06-10 at 1 35 38 PM Screenshot 2023-06-10 at 1 40 08 PM

Desktop (please complete the following information):

Additional context My videos, processed, and data volumes all point to directories on an external drive. Access was provided to Docker when prompted.

ShaneIsrael commented 1 year ago

There isn't anything I can help with unless you give me logs of the errors.

Give me a screenshot of what the browser console window shows when this error pops up, to do that you can right click anywhere on the page and select "inspect element" and then go to the "console" tab on the window that opens. Refresh the page, and if anything shows up in the console screenshot it and paste it here.

The other very important log to give me is the docker logs. You can view the logs of the container by open a terminal on your mac and doing docker logs -f fireshare, then refresh the page or whatever you need to do to make that error message come up. You should see some sort of error stack trace in the terminal. Copy the entire thing and paste it here.

Could you also copy your docker-compose.yml and paste it here as well. More than likely this is an issue with your setup.

HillbillyZT commented 1 year ago

Sorry I even opened up the logs and just completely forgot to attach anything.

Here are the web logs: localhost-1686507214110.log localhost-1686507492059.log

Here are the docker logs: fireshare.log.txt

Here is my docker-compose.yml (secrets changed): docker-compose.yml.txt

I've tried running the docker commands with privileges as well as labeling the container as privileged in the .yml with no success.

ShaneIsrael commented 1 year ago

@HillbillyZT I think the issue is that the directory you mapped to the fireshare /data directory is set to "read-only" and fireshare is unable to write to that folder. The /data and /processed volume maps need to be read and write capable. Your videos directory can stay "read only" if you want, however if you ever decided to try and delete a video from within the Fireshare UI it would throw an error, but should still work.

HillbillyZT commented 1 year ago

The drive as a whole and all of the directories in it are both read and write enabled. This is not the issue. I've tried reformatting the drive to APFS as well to see if it was an exFAT/MacOS permissions issue, and it is not. Fireshare is able to create files and subdirectories in /data without issue, as evidenced by data/config.json, processed/derived and processed/video_links all being created. The complaints in the docker logs are gone with the filesystem change, as well as the python exceptions, but the browser logs are still full of errors: localhost-1686507492059.log

HillbillyZT commented 1 year ago

Trying to run this locally also runs into lots of issues. I'm not sure if there are unlisted build dependencies or other issues. Here are the logs. I have python, node, and npm.

run_local.log

ShaneIsrael commented 1 year ago

The original issue, and the reason I asked about the directory being read only is because the error logs gives this.

fireshare  | Traceback (most recent call last):
fireshare  |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", line 1819, in _execute_context
fireshare  |     self.dialect.do_execute(
fireshare  |   File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py", line 732, in do_execute
fireshare  |     cursor.execute(statement, parameters)
fireshare  | sqlite3.OperationalError: attempt to write a readonly database
fireshare  | 
fireshare  | The above exception was the direct cause of the following exception:

Which says fireshare is unable to write to the database because its a read-only file. So something must have changed the file permissions of those files in that directory. Check the permissions of the database file in the /data volume. The errors are happening because fireshare can't create its database and is unable to create the admin user.

Running local isn't working because you need to have python flask installed.

HillbillyZT commented 1 year ago

I've installed flask... New Text Document.txt

Also, here is the docker log after I changed the filesystem. fireshare.log.2.txt

ShaneIsrael commented 1 year ago

That looks like a normal startup now.

ShaneIsrael commented 1 year ago

Assuming this has been resolved.

HillbillyZT commented 1 year ago

It has not been. Please see the web log I provided in https://github.com/ShaneIsrael/fireshare/issues/197#issuecomment-1586319554 The docker logs are clean now, but the web page still complains about Access to XMLHttpRequest at 'http://localhost:5000/api/loggedin' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. AuthWrapper.js:15 o {message: 'Network Error', name: 'AxiosError', code: 'ERR_NETWORK', config: {…}, request: XMLHttpRequest, …}

(the web logs) https://github.com/ShaneIsrael/fireshare/files/11715606/localhost-1686507492059.log

ShaneIsrael commented 1 year ago

Seems to be specific to Mac for some reason. Localhost should work fine, but you can get around this by instead going to either 0.0.0.0:8080 or 127.0.0.1:8080