InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

cannot log in to old interface 16.8 after logging out

Open tomse opened this issue 2 years ago • 9 comments

Please verify that this bug has NOT been raised before.

  • [x] I checked and didn't find a similar issue

Describe the bug*

trying to log in with the correct credentials on the old interface just "refreshes" the login page

trying the new interface it's possible to login with the same credentials.

This wasn't an issue until logging out (auto login worked fine)

Steps to Reproduce

  1. make sure you are logged out
  2. go to login page
  3. click the try new interface link
  4. login
  5. see the new site..
  6. log out
  7. try and log in to old site

Expected behaviour

expected to have a login, and see my default page

Deployment Method

  • [x] Docker
  • [ ] Package
  • [ ] Bare metal
  • [ ] Other - added info in Steps to Reproduce

Version Information

16.8

Please verify if you can reproduce this bug on the demo site.

  • [ ] I can reproduce this bug on the demo site.

Relevant log output


tomse avatar Nov 20 '24 22:11 tomse

I appreciate you looking through similar issues before creating an issue... https://github.com/inventree/InvenTree/issues/8481

matmair avatar Nov 20 '24 22:11 matmair

  • https://docs.inventree.org/en/latest/faq/#breaking-changes
  • https://docs.inventree.org/en/latest/start/config/#server-access
  • https://docs.inventree.org/en/latest/releases/release_notes/#stable-releases
  • https://github.com/inventree/InvenTree/releases/tag/0.16.7

Read through the "breaking changes" section of the 0.16.7 release notes

SchrodingersGat avatar Nov 20 '24 23:11 SchrodingersGat

@matmair that bug is closed and didn't fix my issue. closest is #8533 but didn't mention login problems until later.

.env file

# Ensure debug is false for a production setup INVENTREE_DEBUG=false

changed to

# Ensure debug is false for a production setup INVENTREE_DEBUG=true

and it works.. switching debugging off reintroduces the problem.

there are 2 issues. logon, and missing pictures same as #8533 both are fixed if debugging is switched on

it seems that the images are created/recreated when having a successful logon (only with debugging true), after this, the images are showing properly when debugging is set to false and logging into the new website.

reload webpage on the new site shows login page again (with debug set to false)

for any one having similar issues (and google) and see this: I did replace the old docker-compose and .env file (copying my settings from the old file) as there are some changes to these files. My docker-compose file was from 0.12.x release - what I didn't notice in the upgrade documentation was the change in products from nginx to caddy for the reverse proxy

tomse avatar Nov 21 '24 18:11 tomse

it seems that the images are created/recreated when having a successful logon (only with debugging true),

"images" - do you mean product pictures, image files etc?

Did you run invoke update?

SchrodingersGat avatar Nov 21 '24 22:11 SchrodingersGat

Hi, I have encountered the same problem (update from 0.16.6 ⇾ 0.16.8). I did some testing based on the different Issues I have read,

1.) Tested what @tomse did and have seen the same results:

.env file

# Ensure debug is false for a production setup INVENTREE_DEBUG=false

changed to

# Ensure debug is false for a production setup INVENTREE_DEBUG=true

and it works.. switching debugging off reintroduces the problem.

2.) Tested: (with INVENTREE_DEBUG=false) With the setting: INVENTREE_COOKIE_SAMESITE set to false did docker compose run --rm inventree-server invoke update

This solves the login problems and the missing part pictures. In the old UI, the server status is Healthy, so far so good. In docker logs inventree-server is nothing obvious that looks bad.

Image

But if you open the new UI, the Server status says ISSUES DETECTED and in the docker logs inventree-server this line appears:

192.168.10.123 - - [22/Nov/2024:11:54:16 +0000] "GET /api/notifications/?read=false&limit=1 HTTP/1.1" 200 512 "http://inventree.office.lan/platform/home" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0"
Email backend not configured
InvenTree system health checks failed

Image

I am wondering if there is a real issue, or if this is just a reporting error in the new UI? Can I give the go ahead to use it again in production?

mcsys-dev avatar Nov 22 '24 12:11 mcsys-dev

it seems that the images are created/recreated when having a successful logon (only with debugging true),

"images" - do you mean product pictures, image files etc?

Did you run invoke update?

yes to the pictures (part image)

and yes.. ran docker compose run --rm inventree-server invoke update to be more specific

I didn't add the INVENTREE_COOKIE_SAMESITE with the current settings, as it didn't work prior, and isn't part of the default config, perhaps it should?

I do have the same system information shown as @mcsys-dev except the additional debug mode Server is running in debug mode

tomse avatar Nov 22 '24 14:11 tomse

I had this problem and I think it relates to the breaking change of #8390 . My use case is on a local network without https. I had the problem of refreshed CUI issues, where it would not log in, but was able to login with PUI. Originally I tried adding the INVENTREE_COOKIE_SAMESITE=false but I never set that value in my .env to begin with and it didn't resolve my issue.

I couldn't exactly determine why, because the default should be false, but I had to explicitly allow unsecure cookies. Obviously you should be aware of the implications of this, but in my case it was fine.

I added the line INVENTREE_SESSION_COOKIE_SECURE=false to my .env file and restarted and was able to log in.

I also cleared all browser cookies from my site for good measure.

LastEdit avatar Nov 25 '24 22:11 LastEdit

I got same issue with small change that i got "Authentication Failure" on old interface.

problem:

Cant login to inventree using old login page. Always landed on 'Authentication Failure' screen. But if i login via (new interface)'/platform/login' i secufuly login.

environment:

  • Deployment method: latest docker image to the day 4.12.2024 (0.16.9)
  • config.yaml(in orm of txt without adresses): config.txt
  • inventree was internaly on non standart port and then via nginx proyxy forwarded to another non standart

Tolomaj avatar Dec 04 '24 09:12 Tolomaj

@Tolomaj please refer to the related issues and see if they relate to your problem:

  • https://github.com/inventree/InvenTree/issues/8439
  • https://github.com/inventree/InvenTree/issues/7387
  • https://github.com/inventree/InvenTree/issues/6670
  • https://github.com/inventree/InvenTree/issues/6644

SchrodingersGat avatar Dec 04 '24 09:12 SchrodingersGat