Console Error: Failed response: 415

Created on 13 March 2025, 5 days ago

Problem/Motivation

I have installed and configured the module, but there are a few console errors appearing. Please check if there's a quick fix. Thanks!

Console Error:

Error: Failed response: 415
Autologout has been destroyed.

πŸ› Bug report
Status

Active

Version

1.1

Component

Code

Created by

πŸ‡΅πŸ‡°Pakistan kaleemullah924

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @kaleemullah924
  • πŸ‡΅πŸ‡°Pakistan kaleemullah924

    The error occurs when I log in.

  • πŸ‡ΈπŸ‡ͺSweden andersmosshall

    Hmm 415 status code; Unsupported Media Type is not an error that is thrown by this module. I have not been able to reproduce which indicatest that this is not even thrown by Drupal, but I cannot say that by 100% certainty.
    What does Drupal log when this happens? Is it consistent?

    How ever, the JS in this module does not specify the requested contenttype that might make some servers och firewalls or similar throw the error.

    An obvious improvment would be to have the fetch in the JS script be more specific of what its asks for. I will put that in the the queue improvments. Maybe that would solve your problem...

  • Merge request !2specify format json in js request β†’ (Merged) created by andersmosshall
  • Pipeline finished with Skipped
    5 days ago
    #447712
  • πŸ‡ΈπŸ‡ͺSweden andersmosshall

    Added patch for proposed fix of specify content-type in the JS requests. Even if this does not fix the issue this is a obvious improvment that will go out in the next release.

  • πŸ‡΅πŸ‡°Pakistan kaleemullah924

    Thank you for adding the patch to specify the Content-Type in the JS requests. I have applied the patch and cleared the cache, but unfortunately, the issue still persists.

  • πŸ‡ΈπŸ‡ͺSweden andersmosshall

    Thank you for the feedback. Can you please provide more info about the issue. Like inspect the networktab for clues of what is throwing this error. And check in Drupal logs to get clues of what is causing the error. As mentioned the module does not explicitly throw any 415 error so there must be something else interfering, either deeper level drupal or server infra.

  • πŸ‡΅πŸ‡°Pakistan kaleemullah924

    Please find the attached screenshot of the Network tab. Additionally, the Drupal log displays the following error:

    Client error:
    "Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException: No route found that matches 'Content-Type: application/json' in Drupal\Core\Routing\ContentTypeHeaderMatcher->filter() (line 49 of /var/www/html/docroot/core/lib/Drupal/Core/Routing/ContentTypeHeaderMatcher.php)"

  • πŸ‡ΈπŸ‡ͺSweden andersmosshall

    Ok, thats good. That actuall points to an error thrown in drupal which makes this more likely to be able to solve within the module. In what drupal version do you get this error? I have not yet been able to reproduce this error.

    If you come to think of any other debug info that would be good to know investiating this to narrow down the issue it would be much helpful.
    For example
    What drupal version?
    What browser are you using?
    Do you get same issue on different browser? (All though I dont think this is a client side error but it could be a combination)

  • πŸ‡΅πŸ‡°Pakistan kaleemullah924

    The issue occurs in Drupal version 10.4.3 and is present across multiple browsers, including Chrome, Firefox, and Safari.

Production build 0.71.5 2024