Skip to content

Conversation

@PVince81
Copy link
Member

@PVince81 PVince81 commented Aug 5, 2021

The "name" column is now unused and the code is always inserting an
empty string. While this works with most databases, Oracle complains
because an empty string is equivalent to null.

To fix this, the column definition is changed to allow null values now.

Also added some logging in case of database exceptions, because without
this nothing would be logged to detect the above problem.

@PVince81 PVince81 added this to the Nextcloud 23 milestone Aug 5, 2021
@PVince81 PVince81 self-assigned this Aug 5, 2021
@PVince81 PVince81 changed the title Make "name" column nullable. Make "name" column nullable for workflows Aug 5, 2021
@PVince81
Copy link
Member Author

PVince81 commented Aug 5, 2021

note, I've seen in the JS code that this column is actually legacy and not used any more, see https://github.com/nextcloud/server/blob/master/apps/workflowengine/src/store.js#L105

so probably in the next major version we could remove it completely.

but here I needed a small less impactful fix that we can backport

@PVince81 PVince81 force-pushed the bugfix/noid/flow-oracle-allow-null-on-name branch 2 times, most recently from 238825d to 9beea1b Compare August 5, 2021 09:01
@PVince81 PVince81 force-pushed the bugfix/noid/flow-oracle-allow-null-on-name branch from 9beea1b to 5a7c7c4 Compare August 5, 2021 09:35
@PVince81 PVince81 requested a review from juliusknorr August 5, 2021 09:37
@PVince81
Copy link
Member Author

PVince81 commented Aug 5, 2021

PHP Warning:  require(/drone/src/lib/composer/composer/platform_check.php): failed to open stream: No such file or directory in /drone/src/lib/composer/composer/autoload_real.php on line 25

okay....

@PVince81
Copy link
Member Author

PVince81 commented Aug 5, 2021

weird, so build/autoloaderchecker.sh has generated a new file that did not exist before: lib/composer/composer/platform_check.php

I'll git add it but let me know if this is wrong...

@PVince81 PVince81 force-pushed the bugfix/noid/flow-oracle-allow-null-on-name branch from 5a7c7c4 to 9799ea1 Compare August 5, 2021 09:45
@PVince81
Copy link
Member Author

PVince81 commented Aug 6, 2021

failing test is unrelated, the previous run had a different integration test failing

@juliushaertl can you recheck ?

@PVince81
Copy link
Member Author

PVince81 commented Aug 9, 2021

another weird thing is that apps/workflowengine has a composer folder but no composer.json file, so the dump-autoloader function fails with "No lockfile found. Unable to read locked packages".

so how are we supposed to update the autoloader files in apps with autoloaderchecker.sh ?

or maybe it's the newer composer that refuses that.
when I run the script it downloads and installs composer 2.1.5.
this is with php 7.4.21

@PVince81
Copy link
Member Author

I've asked Arthur to run the script locally and he mentioned no issues when updating, with the same composer version and PHP 7.4.15

so maybe there's something strange in my environment, I'll debug this locally

The "name" column is now unused and the code is always inserting an
empty string. While this works with most databases, Oracle complains
because an empty string is equivalent to null.

To fix this, the column definition is changed to allow null values now.

Also added some logging in case of database exceptions, because without
this nothing would be logged to detect the above problem.

Signed-off-by: Vincent Petry <vincent@nextcloud.com>
@PVince81 PVince81 force-pushed the bugfix/noid/flow-oracle-allow-null-on-name branch from 9799ea1 to 15a62c5 Compare August 10, 2021 09:19
@PVince81
Copy link
Member Author

I've managed to clean the autoloader mess by running the script on a different environment.
For some reason on my local dev env composer behaves differently.

Please recheck

@PVince81 PVince81 requested a review from juliusknorr August 10, 2021 09:20
@PVince81 PVince81 requested a review from CarlSchwan August 11, 2021 06:21
@PVince81 PVince81 merged commit 1daab57 into master Aug 11, 2021
@PVince81 PVince81 deleted the bugfix/noid/flow-oracle-allow-null-on-name branch August 11, 2021 13:52
@PVince81
Copy link
Member Author

/backport to stable22

@PVince81
Copy link
Member Author

/backport to stable21

@PVince81
Copy link
Member Author

/backport to stable20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants