-
-
Notifications
You must be signed in to change notification settings - Fork 798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic plugin static files collection broken after install #7709
Comments
@luwol03 a few different things to address here! Static File Pathing
Static File Copying Does Not Work
|
Good idea to break it into different issues: EDIT: I have added this list to the initial comment now |
I think the migration part of 2 and 5 should be split out as individual issues as they do not seem connected with static content "stuff". |
I agree with point 5, but when looking deeper, issue 2 targets exactly the code added in the static files for plugins pr. It works in dev, but not, (reproducable) in a fresh docker prod setup. And I think if the static file not being collected automatically issue is solved, the task that is offloaded to run the migrations will be fixed too. Can you reproduce that too in a fresh docker prod setup? |
@wolflu05 I think this has been addressed now, please let me know if this is incorrect... |
Only 1 and 4 have been fixed be me in one of my recent prs. 2,3 and 5 have been still not fixed from here: #7709 (comment) |
@wolflu05 good point. If you have some time to look into those? Otherwise I will try to get to it when I can :) |
Sorry, but unfortunately I won't have any time the next weeks. |
Is this issue still happening? |
Yes, I have updated the initial comment now with the list where I have broken down the issue into smaller ones (previously this was only a comment in this discussion, so that this doesn't get lost). Issue 2 and 3 are still not solved. And issue 5 is not reproducible. I have tested with the current latest docker image (updated the version information accordingly). |
I have tested again with ec2051d, and 2,3 and 5 is still not resolved, so I'm reopening it. Now removing the files after disabling the plugin is implemented (3), but the same error as (2) occurs when running without a restart. And I can actually reproduce 5 now again, that's a very strange one. |
@wolflu05 OK, let's work it out! |
I have been using the default docker setup like described in the docs to reproduce it. |
Ok, I have worked out a fix for 2) and 3) - incoming |
@SchrodingersGat ok, I tested it now, it seems to be still not working correctly. I setup the system by using the default prod docker setup, just change the image to But the static files removal works now pretty good after uninstalling the plugin (3). And I was not able to reproduce the property bug (5) anymore. |
@wolflu05 can you please provide aa detailed set of logs and screenshots to show exactly the problem? |
I have tried to reproduce this now a couple of times, but I'm not able. Sorry for the confusion. It seems to work now. Thank you very much your effort finding and fixing this. |
Please verify that this bug has NOT been raised before.
Describe the bug*
I have broken down the issues with plugin static files into multiple smaller ones:
1. Static files path(fixed with #7763)Details
If an
AppMixin
plugin before had astatic
folder and the django app was loaded,invoke static
had already collected the static files in the root of the static folder so a file inmy-plugin/static/panel.js
was served by/static/panel.js
.(to remove clashes between files with the same name from multiple plugins, I placed my static files in
my-plugin/static/my-plugin/panel.js
, so it was served by/static/my-plugin/panel.js
)Now after the mentioned PR, a file in
my-plugin/static/panel.js
is served by/static/plugins/my-plugin/panel.js
. I do not think this change is bad, it just needs to be documented as breaking. One good think would be to provide a{% plugin_static "panel.js" %}
template tag which resolves to the particular plugin static url (/static/plugins/my-plugin/panel.js
) and we back port that to 0.15 which resolves to/static/panel.js
2. Automatic static file copying and migrations are not run after activating a plugin
I can reproduce this in a fresh docker setup (but not in my dev setup running locally). But no idea why only in a production docker setup. (Sometimes only very few times it actually succeeds, but then the migrations are run two times, the first time without any error, and the second they error out, because obviously the table already exists, that the migrations should create). Maybe that's some type of race condition.
inventree-bulk-plugin
(orinventree-kicad
, but that only tests with migrations)inventree-worker | Plugin registry has no record of plugin 'inventree-bulk-plugin'
static/plugins/inventree-bulk-plugin
does not exist (folder should exist)invoke update
the files now exists and the migrations have run3. When deactivating a plugin, the the static files don't get removedWhen deactivating a plugin, the static files get don't removed automatically, a
invoke static
is needed. And even then, nested folders remain.4. AppMixin Plugins with static files causes an error(fixed with #7763)Details
(If 2 is solved, found with my local dev setup where I don't have the issue 2, or when running
invoke static
)5. Property bug (can only sometimes reproduce)=> cannot reproduce anymoreWhen freshly installing a plugin (freshly, not previously installed), and then activating the plugin without restarting the server it can happen that it looks like this:
Error
Deployment Method
Version Information
Please verify if you can reproduce this bug on the demo site.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: