InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

Lost part of interface after data migration

Open JaffarPL opened this issue 1 year ago • 6 comments

Please verify that this bug has NOT been raised before.

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

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

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

Version Information

0.15.4

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

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

Relevant log output

No response

JaffarPL avatar Aug 07 '24 16:08 JaffarPL

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 )

wolflu05 avatar Aug 07 '24 16:08 wolflu05

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: @.***>

JaffarPL avatar Aug 07 '24 18:08 JaffarPL

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

SchrodingersGat avatar Aug 07 '24 22:08 SchrodingersGat

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 avatar Aug 08 '24 06:08 JaffarPL

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

JaffarPL avatar Aug 08 '24 07:08 JaffarPL

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)?

matmair avatar Aug 09 '24 17:08 matmair

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?

saschaludwig avatar Aug 30 '24 16:08 saschaludwig

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

matmair avatar Aug 30 '24 16:08 matmair

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.

saschaludwig avatar Aug 30 '24 16:08 saschaludwig

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.

matmair avatar Aug 30 '24 16:08 matmair

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"

saschaludwig avatar Aug 30 '24 16:08 saschaludwig