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

Deleting a customized folder may cause RecursionError #618

Closed
xyz2357 opened this issue May 12, 2024 · 1 comment
Closed

Deleting a customized folder may cause RecursionError #618

xyz2357 opened this issue May 12, 2024 · 1 comment

Comments

@xyz2357
Copy link

xyz2357 commented May 12, 2024

I created a folder D:\stable-diffusion-webui\outputs\txt2img-images\outputs_archive to store something old. Last time when sdwebui running in background I deleted some folder including outputs_archive. After that, when I try to click "Like" for an image, it shows RecursionError like below.

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "D:\stable-diffusion-webui\venv\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "D:\stable-diffusion-webui\venv\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\fastapi\applications.py", line 273, in __call__
    await super().__call__(scope, receive, send)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\starlette\applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\errors.py", line 184, in __call__
    raise exc
  File "D:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\cors.py", line 92, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\cors.py", line 147, in simple_response
    await self.app(scope, receive, send)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\gzip.py", line 24, in __call__
    await responder(scope, receive, send)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\gzip.py", line 44, in __call__
    await self.app(scope, receive, self.send_with_gzip)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\exceptions.py", line 79, in __call__
    raise exc
  File "D:\stable-diffusion-webui\venv\lib\site-packages\starlette\middleware\exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in __call__
    raise e
  File "D:\stable-diffusion-webui\venv\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\starlette\routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\starlette\routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\starlette\routing.py", line 66, in app
    response = await func(request)
  File "D:\stable-diffusion-webui\venv\lib\site-packages\fastapi\routing.py", line 237, in app
    raw_response = await run_endpoint_function(
  File "D:\stable-diffusion-webui\venv\lib\site-packages\fastapi\routing.py", line 163, in run_endpoint_function
    return await dependant.call(**values)
  File "D:\stable-diffusion-webui\extensions\sd-webui-infinite-image-browsing\scripts\iib\api.py", line 814, in toggle_custom_tag_to_img
    update_extra_paths(conn)
  File "D:\stable-diffusion-webui\extensions\sd-webui-infinite-image-browsing\scripts\iib\api.py", line 192, in update_extra_paths
    r = ExtraPath.get_extra_paths(conn)
  File "D:\stable-diffusion-webui\extensions\sd-webui-infinite-image-browsing\scripts\iib\db\datamodel.py", line 675, in get_extra_paths
    cls.remove(conn, path)
  File "D:\stable-diffusion-webui\extensions\sd-webui-infinite-image-browsing\scripts\iib\db\datamodel.py", line 688, in remove
    target = cls.get_target_path(conn, path)
  File "D:\stable-diffusion-webui\extensions\sd-webui-infinite-image-browsing\scripts\iib\db\datamodel.py", line 660, in get_target_path
    cls.remove(conn, path)
  File "D:\stable-diffusion-webui\extensions\sd-webui-infinite-image-browsing\scripts\iib\db\datamodel.py", line 688, in remove
    target = cls.get_target_path(conn, path)

.....repeat......

  File "D:\stable-diffusion-webui\extensions\sd-webui-infinite-image-browsing\scripts\iib\db\datamodel.py", line 660, in get_target_path
    cls.remove(conn, path)
  File "D:\stable-diffusion-webui\extensions\sd-webui-infinite-image-browsing\scripts\iib\db\datamodel.py", line 688, in remove
    target = cls.get_target_path(conn, path)
  File "D:\stable-diffusion-webui\extensions\sd-webui-infinite-image-browsing\scripts\iib\db\datamodel.py", line 660, in get_target_path
    cls.remove(conn, path)
  File "D:\stable-diffusion-webui\extensions\sd-webui-infinite-image-browsing\scripts\iib\db\datamodel.py", line 688, in remove
    target = cls.get_target_path(conn, path)
  File "D:\stable-diffusion-webui\extensions\sd-webui-infinite-image-browsing\scripts\iib\db\datamodel.py", line 648, in get_target_path
    path = os.path.normpath(path)
  File "C:\Users\USERNAME\.conda\envs\sdwebui\lib\ntpath.py", line 512, in normpath
    prefix, path = splitdrive(path)
  File "C:\Users\USERNAME\.conda\envs\sdwebui\lib\ntpath.py", line 169, in splitdrive
    p = os.fspath(p)
RecursionError: maximum recursion depth exceeded while calling a Python object

I added print(path) before cls.remove(conn, path) (line 688), and see the path triggering that issue is D:\stable-diffusion-webui\outputs\txt2img-images\outputs_archive (not exist at that time). So I add an empty outputs_archive folder there, and the issue is no longer triggered. Deleting the empty folder will retrigger it.
So it sounds like a backup procedure failed to remove the folder from database when I delete it manually.
(Deleting folders created by sdwebui are fine).

@zanllp
Copy link
Owner

zanllp commented May 15, 2024

Already fixed

@xyz2357 xyz2357 closed this as completed May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants