inventree / InvenTree

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

Lost part of interface after data migration #7826

Closed JaffarPL closed 2 months ago

JaffarPL commented 3 months ago

Please verify that this bug has NOT been raised before.

Describe the bug*

I had to move inventree database from one machine to another. Source installation was on docker. Destination - bare metal. I got prepared data.json file as in https://docs.inventree.org/en/latest/start/migrate/ manual. Copied data catalog from one machine to another (to save images). Next on destination machine i got run invoke import-records -c -f data.json and i think almost everything is in new installation DB (I've lost only attachments).

But...

Part of interface on new installation disappeared. When I get into parts/stock/etc, I have onlu 1/3 of interface. Windows marked red are invisible. 2024-08-07 17_55_44-InvenTree _ Stan

I've looked into web browser console and I see jQuery errors like on picture below (like some icon packs were not found? - loadApiIconPacks): 2024-08-07 17_43_33-(68) IDZIEMY NA POLOWANIE! - Sons of The Forest by reZi odc  6 - YouTube

Have anyone seen such problem?

Steps to Reproduce

Not sure if it can be reproduced.

  1. migrate DB from one instance to another
  2. login
  3. part of interface invisible

Expected behaviour

Those parts of interface should be visible

Deployment Method

Version Information

0.15.4

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

Relevant log output

No response

wolflu05 commented 3 months ago

Have you run invoke update on your new machine? And have you cleared your browsers cache? (See https://docs.inventree.org/en/stable/faq/#feature-x-does-not-work-after-update )

JaffarPL commented 3 months ago

Yes

On Wed, Aug 7, 2024 at 6:36 PM Lukas @.***> wrote:

Have you run invoke update on your new machine?

— Reply to this email directly, view it on GitHub https://github.com/inventree/InvenTree/issues/7826#issuecomment-2273875330, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLBYEVK7DNWKFUR4Q5YSIDZQJEI7AVCNFSM6AAAAABMEW5YZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZTHA3TKMZTGA . You are receiving this because you authored the thread.Message ID: @.***>

SchrodingersGat commented 3 months ago

Have you done a hard refresh on the page? Could be a cache issue:

https://docs.inventree.org/en/latest/faq/#feature-x-does-not-work-after-update

JaffarPL commented 3 months ago

Yes. I did Ctrl F5

czw., 8 sie 2024, 00:38 użytkownik Oliver @.***> napisał:

Have you done a hard refresh on the page? Could be a cache issue:

https://docs.inventree.org/en/latest/faq/#feature-x-does-not-work-after-update

— Reply to this email directly, view it on GitHub https://github.com/inventree/InvenTree/issues/7826#issuecomment-2274467881, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHLBYERGHVCE5VV7IGIAQ53ZQKOXXAVCNFSM6AAAAABMEW5YZ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZUGQ3DOOBYGE . You are receiving this because you authored the thread.Message ID: @.***>

JaffarPL commented 3 months ago

I have just found out that the thing is not related to migration itself, but ip change. After I did database migration, I've turned off old machine and changed IP of new one. After restart, part of interface has gone. If I set it back to origin IP, it shows parts list etc

matmair commented 3 months ago

This sounds like the site_url is not set up correctly. Can you check that in the global setting and your docker environment settings (INVENTREE_SITE_URL)?

saschaludwig commented 2 months ago

I had the same symptoms with loadApiIconPacks is not defined in a docker-compose environment. My INVENTREE_SITE_URL however, was set to the correct value.

After fiddling around with various caddy header settings, I ended up in running ./manage.py collectstatic and that ultimately fixed the issue.

My docker environment is automatically updated via watchtower whenever the docker images are updated. Is there a way to ensure, that after an update, collectstatic is run automatically?

matmair commented 2 months ago

You need to follow the upgrade instructions, just pulling an image is not enough -> https://docs.inventree.org/en/stable/start/docker_install/?h=update#updating-inventree

saschaludwig commented 2 months ago

Yes you are absolutely right. Sadly, in a Portainer Environment, the way of running invoke update isn't working, and I haven't found a way of doing that, other than from a Portainer Shell in the inventree-server container.

matmair commented 2 months ago

We only support the documented order of operations. We do not have the resources to support the multitude of docker-ish platforms in our free time.

saschaludwig commented 2 months ago

We only support the documented order of operations. We do not have the resources to support the multitude of docker-ish platforms in our free time.

I totally understand that, and my comment was never meant to be a reproach that you didn't. Instead, your answer got me to the point where I might have figured out how to run invoke update after watchtower updated the container. https://containrrr.dev/watchtower/lifecycle-hooks/

Looks like setting the watchtower environment var WATCHTOWER_LIFECYCLE_HOOKS=true and adding a label to the inventree-server container might do the trick:

        labels:
          - "com.centurylinklabs.watchtower.lifecycle.post-update='invoke update'"
          - "com.centurylinklabs.watchtower.lifecycle.post-update-timeout=0"