Skip to content

Conversation

@provokateurin
Copy link
Member

Summary

Since #32877 the index is no longer unique and there can be duplicate entries in oc_mounts. This repair step removes them, but doesn't fix the root cause.

Checklist

@provokateurin provokateurin added this to the Nextcloud 32 milestone Jul 21, 2025
@provokateurin provokateurin requested a review from a team as a code owner July 21, 2025 09:10
@provokateurin provokateurin requested review from yemkareems and removed request for a team July 21, 2025 09:10
@provokateurin provokateurin added the 3. to review Waiting for reviews label Jul 21, 2025
@provokateurin provokateurin force-pushed the feat/repair-step-deduplicate-mounts branch from 06e274c to 974a08c Compare July 21, 2025 10:14
@provokateurin provokateurin force-pushed the feat/repair-step-deduplicate-mounts branch from 974a08c to 0e4cab9 Compare July 21, 2025 11:18
@nickvergessen

This comment was marked as resolved.

@provokateurin provokateurin force-pushed the feat/repair-step-deduplicate-mounts branch from 0e4cab9 to 00eb35f Compare July 21, 2025 12:13
@nickvergessen
Copy link
Member

/backport! to stable31

@nickvergessen
Copy link
Member

Need to trigger the backport for updated autoloader files

Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Robin it is fine to remove all entries, so instead we should use

/**
* Truncate a table data if it exists
*
* Cascade is not supported on many platforms but would optionally cascade the truncate by
* following the foreign keys.
*
* @param string $table table name without the prefix
* @param bool $cascade whether to truncate cascading
* @throws Exception
* @since 32.0.0
*
* @psalm-taint-sink sql $table
*/
public function truncateTable(string $table, bool $cascade): void;

Then we also don't need a progressbar or anything.

@salmart-dev
Copy link
Contributor

According to Robin it is fine to remove all entries, so instead we should use

/**
* Truncate a table data if it exists
*
* Cascade is not supported on many platforms but would optionally cascade the truncate by
* following the foreign keys.
*
* @param string $table table name without the prefix
* @param bool $cascade whether to truncate cascading
* @throws Exception
* @since 32.0.0
*
* @psalm-taint-sink sql $table
*/
public function truncateTable(string $table, bool $cascade): void;

Then we also don't need a progressbar or anything.

I removed the code deleting rows and just added a truncate table statement. I also removed the test, since IMO there's no point in testing this.

@provokateurin
Copy link
Member Author

@salmart-dev autoloaders need to be updated.

@salmart-dev
Copy link
Contributor

@provokateurin I undid the change with the prefix which didn't make sense and the original error is back: on Oracle tests ERROR: An exception occurred while executing a query: ORA-00942: table or view "SYSTEM"."OC_MOUNTS" does not exist

Do you have any idea why this may be happening? looking at the error, it seems like the right DB is not being selected (system instead of nextcloud).

This was referenced Aug 22, 2025
@nickvergessen
Copy link
Member

Truncate is rather new, maybe it was never used/tested against Oracle?
https://github.com/nextcloud/server/blame/5ecd3c4b495f3fdd959b2e2f8569a402b5d84af0/lib/private/DB/Connection.php#L715-L718

But can't see from a quick glance where it would do something wrong.

This was referenced Aug 28, 2025
This was referenced Sep 4, 2025
This was referenced Sep 25, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
@provokateurin
Copy link
Member Author

@salmart-dev maybe truncate is available now, since we dropped some really old Oracle versions.

provokateurin and others added 6 commits December 2, 2025 15:56
Signed-off-by: provokateurin <kate@provokateurin.de>
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
@provokateurin
Copy link
Member Author

Closing in favor of #56933

@provokateurin provokateurin deleted the feat/repair-step-deduplicate-mounts branch December 9, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants