butaixianran / Stable-Diffusion-Webui-Civitai-Helper

Stable Diffusion Webui Extension for Civitai, to manage your model much more easily.
2.37k stars 286 forks source link

Permission error #287

Open Eoftar opened 2 months ago

Eoftar commented 2 months ago

Issue started popping up today, everything was fine before. Now Civitai extention refuses to download previews and sha for models. I deleted the old extention and downloaded the new one(this one). The problem remains.

For some reason only new models are affected by this - I deleted a preview image for an old model I had, the preview downloaded fine. For some reason it only affects the models I downloaded recently - a few sdxl checkpoints and loras.

Traceback (most recent call last):
  File "J:\SD Forge\system\python\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "J:\SD Forge\system\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api
    result = await self.call_function(
  File "J:\SD Forge\system\python\lib\site-packages\gradio\blocks.py", line 1103, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "J:\SD Forge\system\python\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "J:\SD Forge\system\python\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "J:\SD Forge\system\python\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "J:\SD Forge\system\python\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "J:\SD Forge\webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\civitai_helper.py", line 99, in scan_model
    return model_action_civitai.scan_model(scan_model_types, max_size_preview, skip_nsfw_preview)
  File "J:\SD Forge\webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\model_action_civitai.py", line 58, in scan_model
    hash = util.gen_file_sha256(item)
  File "J:\SD Forge\webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\util.py", line 40, in gen_file_sha256
    for block in read_chunks(f, size=blocksize):
  File "J:\SD Forge\webui\extensions\Stable-Diffusion-Webui-Civitai-Helper\scripts\ch_lib\util.py", line 28, in read_chunks
    chunk = file.read(size)
PermissionError: [Errno 13] Permission denied

What do I do?

butaixianran commented 2 months ago

I don't have this problem.

This is not a civitai error, seems you don't have the permission to read your files.

From your error message, it looks like a multiple threads error. But this extension does not use multiple threads at all.

I also noticed you are using Forge, not SD webui. Maybe you should ask your question there.

Eoftar commented 2 months ago

I doubt it is Forge problem as I also tried to update those checkpoints and loras through my backup Automatic1111 web ui - same problem. I tried to check out "read only" mark on my "web ui" folder. Well, the Loras did pass the scan, got their shas and previews. SDXL checkpoints still give me this permission error.

Will try to check it out on the whole Forge folder, maybe it'll help. I just don't know what else could be the problem with permissions as I have admin access.

Eoftar commented 2 months ago

Seems like I've found the workaround. Still don't know what the problem was, but I've managed to scan and upload info manually, through civitai url.

butaixianran commented 2 months ago

Your error message is happend on a package named "anyio", which is for multiple threads. But this extension does not use that package.

You may want to search "anyio Permission denied sd webui" or something similiar to find useful information.