Installing OMP from github

Hi,

I am trying to install the OMP main branch to try out version 3.4. I am doing this as described on https://docs.pkp.sfu.ca/dev/documentation/en/getting-started.html#install.
Composer reports a few warnings, but ‘npm build’ returns an error:

> OMP@3.3.0 build
> vue-cli-service build --no-clean

Browserslist: caniuse-lite is outdated. Please run:
  npx browserslist@latest --update-db
  Why you should do it regularly: https://github.com/browserslist/browserslist#browsers-data-updating

⠹  Building for production.../srv/www/omp00/htdocs/node_modules/loader-runner/lib/LoaderRunner.js:106
			throw new Error("callback(): The callback was already called.");
			      ^

Error: callback(): The callback was already called.
    at context.callback (/srv/www/omp00/htdocs/node_modules/loader-runner/lib/LoaderRunner.js:106:10)
    at /srv/www/omp00/htdocs/node_modules/css-loader/dist/index.js:141:5

Node.js v18.12.1

I also tried ‘tools/buildpkg.sh 3.4 main’, the same thing happens.
‘npm audit fix’ doesn’t help either.
Shouldn’t the first installation just work like that? What could be a possible error?
I’m new to composer and node/npm, any help would be appreciated.

Hi @ohilbig01,

You’re running into a change between Node 16 and Node 17 that affects some of our dependencies. See https://stackoverflow.com/questions/69962209/what-is-openssl-legacy-provider-in-node-js-v17 for details. You can either downgrade to Node 16, or use the following command instead:

NODE_OPTIONS=--openssl-legacy-provider npm run build

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,

thank you, that helped. I used node v16.18.1 and ‘npm run build’ runs through without error, only with deprecation notes and warnings.

Hi @asmecher,

when I try to upgrade an existing OMP 3.3.0.13 to 3.4 i get the following error:

2022-12-09 11:07:45 [Nulling non-existent source_submission_file_id 1660 in submission_files.]
2022-12-09 11:07:45 [migration: APP\migration\upgrade\v3_4_0\I6093_AddForeignKeys]
2022-12-09 11:07:51 [revert migration: APP\migration\upgrade\v3_4_0\PreflightCheckMigration]
2022-12-09 11:07:51 [An upgrade step failed! Fallback set to 3.3.9.9. Check and correct the error and try the upgrade again. We recommend restoring from backup, though you may be able to continue without doing so.]
ERROR: Upgrade failed: DB: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`omp00db`.`#sql-448_298`, CONSTRAINT `stage_assignments_user_group_id` FOREIGN KEY (`user_group_id`) REFERENCES `user_groups` (`user_group_id`) ON DELETE CASCADE) (SQL: alter table `stage_assignments` add constraint `stage_assignments_user_group_id` foreign key (`user_group_id`) references `user_groups` (`user_group_id`) on delete cascade)

Hi @ohilbig01,

Version 3.4 had not yet been released and will be unstable. Please stick with 3.3 unless you are prepared to deal with bugs and instability.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher ,
yes, I am aware of that. I thought it would be useful to report this error.

Hi @ohilbig01,

Are you sure you’re using an up-to-date checkout? Orphaned data in stage_assignments referring to non-existent user_group_id entries in user_groups should be cleaned up during the preflight check migration here.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

what I do is this:

git clone https://github.com/pkp/omp.git
git submodule update --init --recursive

edit config.inc.php

composer --working-dir=lib/pkp install
composer --working-dir=plugins/paymethod/paypal install

nvm use v16.18.1
npm install
npm audit fix
npm run build

I assume the installation is then up-to-date.
When i do a completely new installation, it works like this.

But when I use an existing database (version OMP 3.3.0.13) and the associated files folder and try to update:

php tools/upgrade.php upgrade

then I get the error described above.

Hi @ohilbig01,

Thanks, I identified a small typo in the preflight check data cleanup that prevented it from catching and cleaning up some inconsistent data in your database:

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

This topic was automatically opened after 6 days.