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

[BUG] When trying to delete a config, the captcha can not be generated #85

Closed
1 task done
RobHofmann opened this issue Dec 3, 2024 · 5 comments · Fixed by #87
Closed
1 task done

[BUG] When trying to delete a config, the captcha can not be generated #85

RobHofmann opened this issue Dec 3, 2024 · 5 comments · Fixed by #87
Assignees
Labels

Comments

@RobHofmann
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When trying to delete a configuration, it will throw the following error in the docker logs:

fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
      System.Exception: No usable font found
         at Duplicati.WebserverCore.Services.CaptchaService.CaptchaUtil.CreateCaptcha(String answer, Size size, Single fontsize)
         at Duplicati.WebserverCore.Services.CaptchaService.GetCaptchaImage(String token)
         at Duplicati.WebserverCore.Endpoints.V1.Captcha.<>c.<Map>b__0_0(ICaptchaProvider captchaProvider, IHttpContextAccessor httpContextAccessor, String token, CancellationToken ct)
         at lambda_method205(Closure, EndpointFilterInvocationContext)
         at Duplicati.WebserverCore.Middlewares.HostnameFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
         at Duplicati.WebserverCore.Middlewares.LanguageFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
         at Microsoft.AspNetCore.Http.RequestDelegateFactory.<ExecuteValueTaskOfObject>g__ExecuteAwaited|129_0(ValueTask`1 valueTask, HttpContext httpContext, JsonTypeInfo`1 jsonTypeInfo)
         at Duplicati.WebserverCore.Middlewares.WebsocketExtensions.<>c__DisplayClass0_0.<<UseNotifications>b__0>d.MoveNext()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)

Expected Behavior

No response

Steps To Reproduce

  1. Start duplicati docker
  2. Create configuration
  3. Delete configuration
  4. Captcha won't be generated & you are unable to delete the config.

Environment

- OS:Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-193-generic x86_64)
- How docker service was installed: docker run command

CPU architecture

x86-64

Docker creation

docker network create --subnet <redacted>/24 uplink-duplicati || true
docker run --name=duplicati --cpus=4 --memory=1GB -d --restart=unless-stopped --net=uplink-duplicati -v /<redacted>/Duplicati/config:/config -v /<redacted>:/docker:ro -v /<redacted>:/hofpudcr102:ro -v /<redacted>:/hofpudcr103:ro -v /<redacted>:/hofpudcr104:ro -v /nfs/media:/media:ro -v /nfs/backup:/backup:ro -e PGID=0 -e PUID=0 linuxserver/duplicati:latest
docker network connect traefik-internal duplicati || true

Container logs

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    0
User GID:    0
───────────────────────────────────────
Linuxserver.io version: v2.1.0.2_beta_2024-11-29-ls225
Build-date: 2024-11-29T16:39:04+00:00
───────────────────────────────────────

***      Missing encryption key, unable to encrypt your settings database     ***
*** Please set a value for SETTINGS_ENCRYPTION_KEY and recreate the container ***
[custom-init] No custom files found, skipping...
Inside getter
Server has started and is listening on port 8200
Connection to localhost (::1) 8200 port [tcp/*] succeeded!
[ls.io-init] done.
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[1]
      An unhandled exception has occurred while executing the request.
      System.Exception: No usable font found
         at Duplicati.WebserverCore.Services.CaptchaService.CaptchaUtil.CreateCaptcha(String answer, Size size, Single fontsize)
         at Duplicati.WebserverCore.Services.CaptchaService.GetCaptchaImage(String token)
         at Duplicati.WebserverCore.Endpoints.V1.Captcha.<>c.<Map>b__0_0(ICaptchaProvider captchaProvider, IHttpContextAccessor httpContextAccessor, String token, CancellationToken ct)
         at lambda_method205(Closure, EndpointFilterInvocationContext)
         at Duplicati.WebserverCore.Middlewares.HostnameFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
         at Duplicati.WebserverCore.Middlewares.LanguageFilter.InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next)
         at Microsoft.AspNetCore.Http.RequestDelegateFactory.<ExecuteValueTaskOfObject>g__ExecuteAwaited|129_0(ValueTask`1 valueTask, HttpContext httpContext, JsonTypeInfo`1 jsonTypeInfo)
         at Duplicati.WebserverCore.Middlewares.WebsocketExtensions.<>c__DisplayClass0_0.<<UseNotifications>b__0>d.MoveNext()
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
Copy link

github-actions bot commented Dec 3, 2024

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@thespad
Copy link
Member

thespad commented Dec 3, 2024

Can you exec into the container and try running:

echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | debconf-set-selections
apt-get update && apt-get install -y --no-install-recommends ttf-mscorefonts-installer

And then try again. It looks like it's after one of these fonts https://github.com/duplicati/duplicati/blob/e3e814a09fee33ed0d26a3662bace449eabcc4af/Duplicati/WebserverCore/Services/CaptchaService.cs#L25-L26

@RobHofmann
Copy link
Author

yes this fixes it!

@RobHofmann
Copy link
Author

Can we incorporate this into the linuxserver/duplicati image by default? :)

@thespad
Copy link
Member

thespad commented Dec 3, 2024

Yes, I'll sort out a PR to add the fonts to the image.

@thespad thespad added the bug label Dec 3, 2024
@thespad thespad self-assigned this Dec 3, 2024
@LinuxServer-CI LinuxServer-CI moved this from Issues to Done in Issue & PR Tracker Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants