inventree / InvenTree

Open Source Inventory Management System
https://docs.inventree.org
MIT License
4.31k stars 778 forks source link

Cannot switch to PUI - `None` shown in browser #8393

Closed Keybored02 closed 2 days ago

Keybored02 commented 2 weeks ago

Please verify that this bug has NOT been raised before.

Describe the bug*

When prompted to switch to PUI during login, if link is clicked no UI is loaded.Image This is not affected by the browser or machine accessing it. It happens with inventree.localhost too, with and without SSL certification. No error report is shown in the admin console. Unsure where the log files are located with DEBUG disabled.

Steps to Reproduce

  1. From the login screen, click the link to PUI switch.

Expected behaviour

The UI is switched from CUI to PUI, as in the demo. A new login page appears.

Deployment Method

Version Information

Version Information:

InvenTree-Version: 0.17.0 dev Django Version: 4.2.14

Database: sqlite3 Debug-Mode: False Deployed using Docker: False Platform: Linux-5.10.0-33-amd64-x86_64-with-glibc2.31 Installer: None

Active plugins: [{'name': 'InvenTreeBarcode', 'slug': 'inventreebarcode', 'version': '2.1.0'}, {'name': 'InvenTreeCoreNotificationsPlugin', 'slug': 'inventreecorenotificationsplugin', 'version': '1.0.0'}, {'name': 'InvenTreeCurrencyExchange', 'slug': 'inventreecurrencyexchange', 'version': '1.0.0'}, {'name': 'InvenTreeLabel', 'slug': 'inventreelabel', 'version': '1.1.0'}, {'name': 'InvenTreeLabelMachine', 'slug': 'inventreelabelmachine', 'version': '1.0.0'}, {'name': 'InvenTreeLabelSheet', 'slug': 'inventreelabelsheet', 'version': '1.0.0'}, {'name': 'DigiKeyPlugin', 'slug': 'digikeyplugin', 'version': '1.0.0'}, {'name': 'LCSCPlugin', 'slug': 'lcscplugin', 'version': '1.0.0'}, {'name': 'MouserPlugin', 'slug': 'mouserplugin', 'version': '1.0.0'}, {'name': 'TMEPlugin', 'slug': 'tmeplugin', 'version': '1.0.0'}, {'name': 'KiCadLibraryPlugin', 'slug': 'kicad-library-plugin', 'version': '1.4.3'}]

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

Relevant log output

13:32:35 server inventree-web-1.service[2275]: Manifest file not found Oct 29 13:32:35 server inventree-web-1.service[2275]: 192.168.1.15 - - [29/Oct/2024:12:32:35 +0000] "GET /platform HTTP/1.0" 200 401 "http://192.168.1.96/accounts/login/?next=/" "Mozilla/5.0 > Oct 29 13:32:35 server inventree-web-1.service[2281]: 192.168.1.15 - - [29/Oct/2024:12:32:35 +0000] "GET /favicon.ico HTTP/1.0" 302 0 "http://192.168.1.96/platform" "Mozilla/5.0 (Windows NT 1> Oct 29 13:32:35 server inventree-web-1.service[2274]: 192.168.1.15 - - [29/Oct/2024:12:32:35 +0000] "GET /accounts/login/?next=/favicon.ico HTTP/1.0" 200 8517 "http://192.168.1.96/platform" "> lines 980-1002/1002 (END)

SchrodingersGat commented 2 weeks ago

You may not have compiled the frontend code when updating - this may be skipped depending on your setup.

Run the following command:

invoke update --frontend

And then restart the server. LMK if you see the frontend code then

Keybored02 commented 2 weeks ago

Hi, thanks for the fast response.

Unfortunately it didn't work. invoke update does run without errors, but the issue remains the same.

I also tried stopping the service inventree before invoking, still no luck.

Maybe a general update would benefit it?

I used the provided installer for the initial setup btw.

SchrodingersGat commented 2 weeks ago

Does the web browser provide any error / warning information in the console?

Keybored02 commented 2 weeks ago

No, there's only a generic warning regarding COOP headers being ignored due to the fact that I don't use HTTPS. This message is common to both CUI and PUI, and it doesn't seem to have any impact.

SchrodingersGat commented 2 weeks ago

This line in your logs might be important:

13:32:35 server inventree-web-1.service[2275]: Manifest file not found

@wolflu05 @matmair any insights into this one?

matmair commented 6 days ago

@Keybored02 can you please provide the full log from invoke update --frontend ?

Keybored02 commented 5 days ago

Sure, full console log here https://pastebin.com/2BP3fWMS

syslog https://pastebin.com/DkP0eSKm

Let me know if you need anything else (and possibly the path to get it, it's all a bit dispersed)

SchrodingersGat commented 5 days ago

If the console log is a complete trace of the command requested by @matmair then this shows a problem - the install command has failed part way through:

Image

This means that the process has not continued - and copied across the required static files to render the frontend. Additionally there are other crucial steps that would have been bypassed also

Keybored02 commented 5 days ago

You're right that might be the issue. I'm not sure whether bypassing or manually uninstalling it would be an option?

matmair commented 5 days ago

@Keybored02 please try running sudo inventree run cli update --uv and paste the output again

Keybored02 commented 5 days ago

Here it is https://pastebin.com/tsaM6k8s (issue still persists)

matmair commented 5 days ago

Are you running a development version?

Keybored02 commented 5 days ago

Yes, [0.17.0 dev]. The default from the installation script.

matmair commented 5 days ago

The installer script defaults to the stable channel. Dev builds do not come with a frontend so this is to be expected.

Keybored02 commented 5 days ago

Sorry, isn't the production installer script separated from the developer setup? I didn't use the latter ofc: https://docs.inventree.org/en/latest/start/installer/

I'll try to replicate it on a clean machine.

Keybored02 commented 5 days ago

Started am install on a fresh VM and it did in fact default to stable and version 0.16.8. No idea what went wrong here, as i used the same steps as before. Any suggested way to rollback? I definitely can do a backup and reinstall, but would it be backwards compatible?

EDIT I mindlessly started the dev server with invoke server and kept using that as a production. That was stupid. I have tested a few ways to migrate without much success, so now I can either:

  1. Switch the branch of my current install to stable and rollback to 0.16.8, hoping for the best.
  2. Wait for 0.17.0 to come around in stable and update dev to that.
  3. Migrate to a fresh install of 0.17.0 with the current backup files.

I can definitely wait for 0.17 so, I'll go with option 2 for now as I've read that it is a contemplated migration path. My question now regards the way to do so. In particular, how do I switch branches in my current dev setup? Can I then migrate following the docs? Also, can something shed a bit of light on the process used in this discussion (import the mysql data before installing inventree - how)?

matmair commented 4 days ago

We do not guarantee backwards migrations so waiting is probably for the best. Just running the installer script should be enough to migrate to stable.

Keybored02 commented 4 days ago

Tried a reinstall with the installer script, and I am now on 0.16.8. The PUI frontend still didn't render. The None text has also disappeared. I tried sudo inventree run cli update --uv and I'm happy to report that it is working now! I'll test this a bit and close the issue if everything runs smoothly.

Thanks to everyone involved for the patience and help!

SchrodingersGat commented 2 days ago

@Keybored02 glad you got it working :)