27.1.6 Update error

I got this error when updating to 27.1.6.

Exception: Database error when running migration 011603Date20230620111039 for app oauth2 An exception occurred while executing a query: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘code_created_at’

Weird. The code can’t execute if it sees that column already[1] so shouldn’t be possible.

Can you re-trigger an occ upgrade command and see if it completes in the second pass (it shouldn’t hurt anything)?

[1] server/apps/oauth2/lib/Migration/Version011603Date20230620111039.php at 075847d07d1f505bc7ec538dab117f9c3dc777ee · nextcloud/server · GitHub

After the failed update I was on 27.1.6 but I preferred to restore a backup back to 27.1.5.

I’ll try again tomorrow, hoping that more people have experienced similar issues and found a solution.

1 Like


Did you check if all apps are compatible with the new version 27.1.6?

  • if an App is incompatible with the new version 27.1.6, the upgrade might encounter failures. To make the upgrade possible,

  • Disable incompatible apps before upgrading NC.

  • Run the upgrade process of Nextcloud

  • Once the upgrade has finished, ensure the cron job has run 3 times or more (=my personal advise) and try your upgraded Nextcloud instance.

  • After Nextcloud is running propery, turn on the disabled incompatible apps.

  • Check your Nextcloud instance again for proper working.

The only third-party app I use is Custom CSS, it’s compatible with NC 28. The app causing the problem is OAuth2, and it’s a default app.

I was able to update without any problems today. I believe it was due to the “Security & setup warnings” message I received yesterday.

“Your IP is currently being throttled by bruteforce.”

I didn’t have this message today, and it updated without any issues.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.