question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

500 error after upgrading: 'SessionStore' object has no attribute '_session_cache' due to binascii.Error: Incorrect padding

See original GitHub issue

Describe the bug

After update from nikisweeting/archivebox to archivebox/archivebox i get Server Error (500) when using nginx If i try to use the IP and http everythings works

Screenshots or log output

Archivebox LOG

[i] [2020-12-03 08:09:35] ArchiveBox v0.4.24: archivebox server 0.0.0.0:8000
> /data

[+] Starting ArchiveBox webserver...
Hint: The admin username is marco

Performing system checks...

System check identified no issues (0 silenced).
December 03, 2020 - 08:09:36
Django version 3.0.8, using settings 'core.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CONTROL-C.
[03/Dec/2020 08:10:25] "GET / HTTP/1.0" 500 145

NGINX conf

server {
        listen 80;
        server_name archivebox.saturn.local;
        return 301 https://archivebox.saturn.local$request_uri;
}

server {
        listen 443 ssl;
        server_name archivebox.saturn.local;

        ssl_certificate /etc/nginx/ssl/cert.crt;
        ssl_certificate_key /etc/nginx/ssl/key.key;

        location / {
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header HOST $host:$server_port;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass http://172.18.10.22:8000;
        }

}

Software versions

  • OS: Unraid 6.8.3
  • ArchiveBox version: v0.4.24

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
piratecommented, Dec 3, 2020

Did you at any point run the :latest version from docker before downgrading back to v0.4.24? That might explain it.

You can try fixing it by running this in archivebox shell:

from django.contrib.sessions.models import Session
Session.objects.all().delete()

You should also clear your browser cookies and cache for https://archivebox.saturn.local so that it doesn’t resend the bad token to the backend, then try logging in again.

This error appears to be specific to Django 3.0.6, and is fixed with 3.1 which we will release with the next ArchiveBox v0.5.0 version in a few weeks, so as long as we get it working for you I’m not too worried about it affecting other users.

https://stackoverflow.com/questions/63546429/binascii-error-incorrect-padding-in-python-django https://code.djangoproject.com/ticket/31592

2reactions
M4RC02U1F4A4commented, Dec 3, 2020

Did you at any point run the :latest version from docker before downgrading back to v0.4.24? That might explain it.

Not at any time, but always, the image is automatically updated to the image on Docker Hub marked as latest

Cleaned cache and cookies and now it works, thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

binascii.Error: Incorrect padding in python django
I had the same error, but it related to some encoded session data. ... _session_cache AttributeError: 'SessionStore' object has no attribute ...
Read more >
#31895 (Decoding an invalid session data crashes.) – Django
_session_cache AttributeError: 'SessionStore' object has no attribute '_session_cache' During handling of the above exception, another exception occurred: ...
Read more >
Sometimes get "incorrect padding error ... - Google Groups
During handling of the above exception ('SessionStore' object has no attribute '_session_cache'), another exception occurred:
Read more >
Sometimes get "incorrect padding error"- new bug in django ...
_session_cache > AttributeError: 'SessionStore' object has no attribute '_session_cache' > During handling of the above exception, ...
Read more >
Django Admin With Docker Error Incorrect Padding - ADocLib
500 error after upgrading: 'SessionStore' object has no attribute 'sessioncache' due to binascii.Error: Incorrect padding #565. I started with a new project ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found