yagiraa / dolphin-free

93 stars 46 forks source link

Exception on /browser_profiles [GET] #11

Closed Garasum closed 1 year ago

Garasum commented 1 year ago

Greetings @yagiraa
After Closing Anty and restarting the computer browser profiles are no longer loading ( Status code 500 , NotADirectoryError: [Errno 20] Not a directory: '/Users/orestharasym/PycharmProjects/dolphin-free/browsers/.DS_Store/info_for_start.json'

System : Apple M1 Pro , Mac OS 13.3.1 , Latest Github Commit Remote Anty has only 4 profiles

Full Stack trace :

ERROR in app: Exception on /browser_profiles [GET]
Traceback (most recent call last):
  File "/Users/orestharasym/PycharmProjects/dolphin-free/venv1/lib/python3.10/site-packages/flask/app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/orestharasym/PycharmProjects/dolphin-free/venv1/lib/python3.10/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/orestharasym/PycharmProjects/dolphin-free/venv1/lib/python3.10/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/orestharasym/PycharmProjects/dolphin-free/venv1/lib/python3.10/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/Users/orestharasym/PycharmProjects/dolphin-free/utils.py", line 62, in wrapper
    ret_val = func(*args, **kwargs)
  File "/Users/orestharasym/PycharmProjects/dolphin-free/main.py", line 157, in browser_profiles
    profile_info = Files.read_from_file(f'browsers/{i}/info_for_start.json')
  File "/Users/orestharasym/PycharmProjects/dolphin-free/modules/files.py", line 25, in read_from_file
    with open(os.path.join(cls.cwd, file), 'r') as f:
NotADirectoryError: [Errno 20] Not a directory: '/Users/orestharasym/PycharmProjects/dolphin-free/browsers/.DS_Store/info_for_start.json'
Garasum commented 1 year ago

Fixed by downloading the fresh version from repository and copy-ing the browser profiles

Still wondering what could go wrong and is there another solution (like clearing the cache )