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

Updating CDash database from 2.2.3 to 2.6.0 updates to '2.8' #780

Closed
timbrown5 opened this issue Dec 14, 2018 · 13 comments
Closed

Updating CDash database from 2.2.3 to 2.6.0 updates to '2.8' #780

timbrown5 opened this issue Dec 14, 2018 · 13 comments

Comments

@timbrown5
Copy link

I have a CDash server running 2.2.3 and running inside a container. I saw that you have released a 2.6.0 version and have provided a container to go with it (https://github.com/Kitware/cdash-docker). I tried using this container and pointing it at a duplicate of our production database.
After getting the container running I got a message on the main CDash page:

The current database schema doesn't match the version of CDash you are running, upgrade your database structure in the Administration/CDash maintenance panel of CDash

I went to the admin page and clicked 'update CDash'. After waiting for the update to complete the above message still appears on the CDash main page.

The current database schema doesn't match the version of CDash you are running, upgrade your database structure in the Administration/CDash maintenance panel of CDash

If I try again to update the database CDash says:

Upgrading tables:
Applying 2.8 patches:

but the message still appears on the main page.

@timbrown5
Copy link
Author

To help when updating from the cli (using: /docker-entrypoint.sh upgrade)

[2018-12-19 08:26:19] cdash.ERROR: Table 'cdash.user' doesn't exist
#0 /var/www/cdash/include/CDash/Database.php(161): CDash\Database->logPdoError(Array)
#1 /var/www/cdash/include/pdo.php(407): CDash\Database->execute(Object(PDOStatement), NULL)
#2 /var/www/cdash/app/Model/User.php(303): pdo_execute(Object(PDOStatement))
#3 /var/www/cdash/include/login_functions.php(58): CDash\Model\User->GetIdFromEmail('root@docker.con...')
#4 /var/www/cdash/include/login_functions.php(286): databaseAuthenticate('root@docker.con...', 'Bfyoz74sA4utNMS...', 'private_no_expi...', false)
#5 /var/www/cdash/include/login_functions.php(315): authenticate('root@docker.con...', 'Bfyoz74sA4utNMS...', 'private_no_expi...', false)
#6 /var/www/cdash/include/common.php(2030): cdash_auth()
#7 /var/www/cdash/public/user.php(28): angular_login()
#8 {main} {"function":"logPdoError","pid":348} 

@zackgalbreath
Copy link
Contributor

Table 'cdash.user' doesn't exist

That's interesting. cdash is the name of your database, right?

@timbrown5
Copy link
Author

timbrown5 commented Jan 4, 2019

Sorry for the late response. Yes cdash is the name our our cdash DB.
I am looking at trying to update to 2.4.0 before updating to 2.6.0.

@dfranco
Copy link

dfranco commented Jan 29, 2019

I have the same issue here upgrading to version 2.6.0

Any help would be really appreciated

@sdinot
Copy link

sdinot commented Mar 5, 2019

I have the same issue, after a migration from CDash 2.2.3 to CDash 2.6.0. I clicked a first time on the "Upgrade CDash" button and the patches for the version 2.4 were applied. I then clicked a second time and the following messages were displayed:

Upgrading tables:
Applying 2.8 patches:

CDash Upgrade Successful.

The following message still appears on the home page:

The current database schema doesn't match the version of CDash you are running, upgrade your database structure in the Administration/CDash maintenance panel of CDash

Sébastien

@sdinot
Copy link

sdinot commented Mar 14, 2019

The following message still appears on the home page:

The current database schema doesn't match the version of CDash you are running, upgrade your database structure in the Administration/CDash maintenance panel of CDash

I took a look at the source code and I found that this message results is due to a SQL query that fails because a column named authenticatesubmissions is missing in the project table.

By comparing the expected and actual schemas, I found two others missing in this table:

  • bugtrackernewissueurl
  • bugtrackertype

And some other field have a slightly different type.

So, I conclude that a stage of the schema migration has been forgotten... :(

How can I fix this issue (by other means than by adding or modifying all columns by hand)?

Sébastien

@zackgalbreath
Copy link
Contributor

Aha, I think this is a bug in the CDash upgrade process. Simply put, it doesn't handle upgrading across multiple versions well. When applying the 2.4 changes on a 2.2 database, it erroneously sets the DB version to 2.6 (not 2.4). So then the 2.6 changes never get applied later. I'll work on fixing this.

In the meantime, if you have access to the database, try running this query:

UPDATE version SET minor = 4;

and then clicking the "Upgrade CDash" button on upgrade.php again.

@sdinot
Copy link

sdinot commented Mar 23, 2019

Thank you for your answer. In the meantime, I found another way to apply the SQL patch by invoking the following url:

https://<cdash.server>/upgrade.php?upgrade-2-6

But, actually, if invoking this url triggers the upgrade of the SQL schema from version 2.4 to version 2.6, the final schema is a little bit different from the schema defined in the sql/mysql/cdash.sql file.

After reordering the declaration of the tables and eliminating some minor cosmetic differences, here are the two files:

A lot of colums, keys, constraints and default values are different, some of them are missing. 5 tables of the extracted schema do not exist in the official schema.

In the end, I abandoned any idea of migration and I opted for a new installation from scratch, forgetting about 6 months rolling results.

This migration was motivated by the support of PHP 7 (it works fine) and the hope to get the buildid back when submitting, because we would like to display it and create a link to the build report in Gitlab (we haven't figured out how to get it back yet :( ).

Sébastien

@zackgalbreath
Copy link
Contributor

get the buildid back when submitting

We've got a merge request open to add a BUILD_ID option to ctest_submit: https://gitlab.kitware.com/cmake/cmake/merge_requests/3120

In the meantime, if you run ctest with --debug it will print to stdout the responses it receives from CDash. You should see the XML response from CDash which contains the buildid that it created.

@timbrown5
Copy link
Author

I am looking at trying to update to 2.4.0 before updating to 2.6.0.
I did for in our instance and it worked around the issue for us.

@gemfony
Copy link

gemfony commented Apr 9, 2020

I installed 2.6.0 (zip file) from scratch, and visiting .../upgrade.php anc clicking on "upgrade database" i also got

Upgrading tables:
Applying 2.8 patches:
CDash Upgrade Successful.

NOTE: my cdash MySQL was created from scratch by install.php!

@timbrown5
Copy link
Author

timbrown5 commented Apr 9, 2020 via email

@williamjallen
Copy link
Collaborator

Migration from CDash 2.x is no longer supported, and the UI discussed here has been removed. See #1948.

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

6 participants