super-table icon indicating copy to clipboard operation
super-table copied to clipboard

Can't install on Craft 4

Open JayBox325 opened this issue 1 year ago • 1 comments

Describe the bug

I am installing Super Table on a Craft 4 project (we're not ready for Craft 5 yet as it's too early in it's lifecycle), and it's impossible to install due to a paradoxical error:

You need to be on at least Super Table 2.7.1 before you can update to Super Table 3.0.0.

I am on Craft 4, so I am trying to install Super Table 3.0.0, but I can't install this until I've installed 2.7.1, which I can't do without being on Craft 3.

Steps to reproduce

  1. Set up a new Craft 4 project
  2. Try to install Super Table 3.0.0

Craft CMS version

4.9.4

Plugin version

3.0.0

Multi-site?

No

Additional context

No response

JayBox325 avatar May 20 '24 15:05 JayBox325

This error should only appear if you have some Super Table data in your database or in your project config files. It will never appear for a new, fresh install. Can you confirm if this is an upgrade, or it was upgraded at some point?

You need to be on the most recent Craft 3 release before upgrading to Craft 4. This error shows that there's some Super Table data, so it was or currently is installed, but at an older version.

I would suggest either removing the Super Table data before installing, or you can remove the row in the plugins database table.

engram-design avatar May 21 '24 11:05 engram-design

Hi, circling back to this one nearly a year later as we ended up getting this all installed working fine.

However, the site is live and we're just running an update to the CMS for the first time and it's just thrown this again. But the thing that is really confusing me, is the CMS knows we're on Supertable 3.0.14, where the evidence is:

Inside the production CMS: image

I have updated the CMS locally working absolutely fine, then pushing to production and running composer install we get:

You need to be on at least Super Table 2.7.1 before you can update to Super Table 3.0.15.

How can I finally get this problem resolved without having to wipe all our Super Table content from the DB?

JayBox325 avatar Jan 09 '25 12:01 JayBox325

Sounds like something is an issue with your project config for that project, and something wasn't applied properly.

I might suggest to "start again" by downloading your production database locally, then running ./craft project-config/rebuild which will rebuild your YAML files according to your production site.

Check what changes there are, but deploying that to production should been things are back in sync.

engram-design avatar Jan 10 '25 01:01 engram-design

I downloaded the production DB, installed it locally, rand the project-config/rebuild command the added the changes to git then pushed this up. The developer handling the deployment (it's not me unfortunately) ran the following:

git pull 
composer install
./craft clear-caches/all

Returns the following:

OK: You need to be on at least Super Table 2.7.1 before you can update to Super Table 3.0.15.

JayBox325 avatar Jan 13 '25 12:01 JayBox325

Right, so again as per my original post something hasn't been updated correctly on your production site. I note you said you managed to get things upgraded correctly, but this doesn't seem to be the case according to this error message you're getting on your production site.

You could throw caution to the wind and directly modify your plugins database table and change the version column to 3.0.15. But this error message is stating that this Craft install is still on the Craft 3 version of Super Table.

Out of interest, what are the row values in the plugins database table for super-table?

engram-design avatar Jan 14 '25 01:01 engram-design

Hi mate, yeah, you're right. Doesn't look like it ever did get resolved. Sorry about this, I know it must be a frustrating one to debug. I appreciate your time and effort.

The plugins database table says:

id	handle	version	schemaVersion	installDate	dateCreated	dateUpdated	uid
26	super-table	3.0.15	3.0.0	2024-05-24 10:14:32	2024-05-24 10:14:32	2025-01-13 11:45:23	13279f3b-ae42-4880-81f1-95fb2cbbe8e0

So everything appears fine there.

JayBox325 avatar Jan 15 '25 19:01 JayBox325

Okay, so the database is reporting the correct version, which is a good start. When you grabbed that database, rebuilt the project config locally, what's the version for that?

You can track down the schemaVersion via /config/project.project.yaml which is a good start to check that's all on-par with the database.

Otherwise, that error is pretty odd. The logic for this check is pretty straightforward, where $plugin->version is referencing a version number less than 2.7.1, which should be impossible given your 3.0.15 version in the database.

engram-design avatar Jan 16 '25 09:01 engram-design

The schemaVersion in the project.yaml file is as follows:

super-table:
    edition: standard
    enabled: true
    schemaVersion: 3.0.0

JayBox325 avatar Jan 16 '25 12:01 JayBox325

Hi @engram-design, so if the DB is saying it's on v3, and the schemaVersion is also 3. What other options could there be?

The deployment process is:

  1. Pull the latest code from the repo
  2. Run composer install
  3. Run ./craft clear-caches/all
  4. Run restart nginx

We're in a spot where we can't update the project until this error is resolved, so any help is appreciated.

JayBox325 avatar Jan 24 '25 10:01 JayBox325

Are you missing a ./craft project-config/apply step in there?

engram-design avatar Jan 24 '25 11:01 engram-design

Hi @engram-design, right, I have worked with the developer in control of production land and he's resolved it. Something to do with how git was working on the production server so it wasn't actually pulling the latest files correctly.

This is the downside of not having access to the production environment myself, so apologise for wasting your time, but thanks for your efforts! Closing.

JayBox325 avatar Jan 24 '25 15:01 JayBox325