Skip to content
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

Plugins with v3 #2221

Closed
nebulade opened this issue Jan 17, 2024 · 12 comments
Closed

Plugins with v3 #2221

nebulade opened this issue Jan 17, 2024 · 12 comments

Comments

@nebulade
Copy link

I am preparing the Cloudron package for v3 and our tests found an issue with the plugins. In v2 the Plugins folder in the app folder was local to this repository, while it is now a link to a private repo at https://github.com/Leantime/plugins/tree/fb23f76357ff1b8405722add67682fddfd4fb1cc

My Question here is, if those plugins are indeed required or if we can just start the app with an empty Plugins folder? Previously it only contained one plugin, the MotivationalQuotes, which is now gone and causes the app to behave erratical after update.

Any hints on how to overcome this situation or some info what to expect would be greatly appreciated.

@marcelfolaron
Copy link
Contributor

Hey,
Yeah with 3.0 we are introducing a plugin marketplace so the default installation starts out with an empty Plugins folder.
For updates this shouldn't impact the contents of the Plugins folder. However on re-builds you'll need to make sure that folder keeps the data. So it might make sense to mount it if you're using docker. We'll update our docs to say that as well.

@nebulade
Copy link
Author

Thanks for the clarification!

@nebulade
Copy link
Author

Reopening this, as clearing out the plugins folder still didn't fix the app when updated. I have encountered some inconsistencies with plugins on a fresh v3 vs an updated leantime instance.

The zp_plugins table on an instance which was upgraded from v2 -> v3 looks as follows:

mysql> describe zp_plugins;
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | int          | NO   | PRI | NULL    | auto_increment |
| name        | varchar(45)  | YES  |     | NULL    |                |
| enabled     | tinyint      | YES  |     | NULL    |                |
| description | varchar(255) | YES  |     | NULL    |                |
| version     | varchar(45)  | YES  |     | NULL    |                |
| installdate | datetime     | YES  |     | NULL    |                |
| foldername  | varchar(45)  | YES  |     | NULL    |                |
| homepage    | varchar(255) | YES  |     | NULL    |                |
| authors     | varchar(255) | YES  |     | NULL    |                |
+-------------+--------------+------+-----+---------+----------------+
9 rows in set (0.00 sec)

This is after a successful migration run:

bin/leantime db:migrate 

[OK] Database Successfully Migrated

now on a fresh installation its looks as follows:

mysql> describe zp_plugins;
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | int          | NO   | PRI | NULL    | auto_increment |
| name        | varchar(45)  | YES  |     | NULL    |                |
| enabled     | tinyint      | YES  |     | NULL    |                |
| description | varchar(255) | YES  |     | NULL    |                |
| version     | varchar(45)  | YES  |     | NULL    |                |
| installdate | datetime     | YES  |     | NULL    |                |
| foldername  | varchar(45)  | YES  |     | NULL    |                |
| homepage    | varchar(255) | YES  |     | NULL    |                |
| authors     | varchar(255) | YES  |     | NULL    |                |
| license     | text         | YES  |     | NULL    |                |
| format      | varchar(45)  | YES  |     | NULL    |                |
+-------------+--------------+------+-----+---------+----------------+
11 rows in set (0.01 sec)

license and format fields are extra here.

I am wondering if there is a migration script missing in the v3 release or if I missed some potentially required manual steps here.

@nebulade nebulade reopened this Jan 18, 2024
@marcelfolaron
Copy link
Contributor

Ah, thanks for bringing that up. I had another user face the update issue. The update script should have created the missing columns. Let me take a look at what's going on there.

@marcelfolaron
Copy link
Contributor

Which version did you update from?

@nebulade
Copy link
Author

This is from 2.4.8 → 3.0.0

Tried also 2.4.8 ⇾ 3.0.2 now, which appears to have a fix for this with dc16820 and I can confirm the table is properly migrated there.

Unfortunately this apparently wasn't the only issue, so I will dig further. To give some context. No errors are shown anywhere, however after the update (not in a fresh v3 instance) the app looks like this:

image

Just as if some css would be broken. Cache is busted and no assets are failing to load, so something is still off.

@marcelfolaron
Copy link
Contributor

Yeah this def looks like a css caching bug. Are you pulling the zip file or are you pulling directly from master?

@nebulade
Copy link
Author

We are pulling the release tarball: https://git.cloudron.io/cloudron/leantime-app/-/blob/main/Dockerfile?ref_type=heads#L7

Taking a second look there and confirming its not a client side caching issue, maybe our start.sh needs some extra cache busting command.

@marcelfolaron
Copy link
Contributor

Thanks, I just took a look at the scripts, couple suggestions that may cause problems:

  1. A few versions ago we changed the folder name structure to be compliant with PSR. That meant capitalizing some of the folders. I noticed that casing inconsistencies can cause really odd behaviors depending on the underlying file system.
    So make sure to rename folder references within app to be capitalized according to: https://github.com/Leantime/leantime/tree/master/app (Plugins, Custom, Core, Domain etc)

  2. It might be worth clearing out the cache folder when you run an update. Laravel should handle that gracefully but again depending on file system it might not always get the memo to refresh cache. You can remove all files within cache, cache/avatars, cache/views. @broskees wasn't there a CLI command to clear cache ?

@marcelfolaron
Copy link
Contributor

On another note: I saw in one of the cloudron forum posts that there may have been a session memory issue. More than likely it is related to the session garbage collection definition in your dockerfile. I am not quite well versed on best practices there so I won't be able to be of much help but thought I'd share :)

@nebulade
Copy link
Author

We were able to publish a package update to v3 now with cache clearing and session timeout. Thanks for all the help!

@marcelfolaron
Copy link
Contributor

marcelfolaron commented Jan 22, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants