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

Error: Database error when running migration 4004Date20230414163505 for app calendar #5304

Closed
solracsf opened this issue Jun 9, 2023 · 25 comments
Assignees
Labels
4. to release Ready to be released and/or waiting for tests to finish bug
Milestone

Comments

@solracsf
Copy link
Member

solracsf commented Jun 9, 2023

Steps to reproduce

  1. occ app:update --all
  2. Error: Database error when running migration 4004Date20230414163505 for app calendar", "Migration step 'OCA\Calendar\Migration\Version4004Date20230414163505' is unknown
  3. occ upgrade fixes the instance
  4. Same error on 2 different instances

Expected behavior

Migration is fine

Actual behaviour

Error.

Calendar app version

4.4.1

CalDAV-clients used

No response

Browser

No response

Client operating system

No response

Server operating system

No response

Web server

Apache

Database engine version

MariaDB

PHP engine version

PHP 8.1

Nextcloud version

25.0.7

Updated from an older installed version or fresh install

Updated from an older version

List of activated apps

No response

Nextcloud configuration

No response

Web server error log

No response

Log file

Error: Database error when running migration 4004Date20230414163505 for app calendar", "Migration step 'OCA\\Calendar\\Migration\\Version4004Date20230414163505' is unknown

Browser log

No response

Additional info

No response

@solracsf solracsf added bug 0. to triage Pending approval or rejection labels Jun 9, 2023
@melroy89
Copy link

melroy89 commented Jun 9, 2023

Duplicate: #5191

The new release 4.4.1 should fix this issue again.. Correct?

@ChristophWurst
Copy link
Member

Yes

@solracsf solracsf reopened this Jun 10, 2023
@solracsf
Copy link
Member Author

solracsf commented Jun 10, 2023

The new release 4.4.1 should fix this issue again.. Correct?

But...this is the 4.4.1 release I'm trying to install 😞

image

@drhirn
Copy link

drhirn commented Jun 10, 2023

The new release 4.4.1 should fix this issue again.. Correct?

Unfortunately not. Had the same error than @solracsf. And after that I'm getting:

The files of the app files_trashbin (files_trashbin), files_versions (files_versions) were not replaced correctly. Make sure it is a version compatible with the server.

NC 26
Tried to update from Calendar 4.3.4 to 4.4.1

@ChristophWurst
Copy link
Member

The calendar release does not fix upgrade errors with files version or files trashbin. What we fixed is the missing class error.

@solracsf

This comment was marked as outdated.

@Struppie
Copy link

maybe also worth to take a look into this related issue? 2727

@flozz

This comment was marked as duplicate.

@heisenbol
Copy link

same here. From 4.3.5 to 4.4.1 on latest nextcloud 25 series.
After the error, when trying to view another page on nextcloud, I was presented with the maintenance screen, telling me that an update was pending. I confirmed to proceed with the update, and everything was resolved

@Struppie
Copy link

@flozz @sksksksk Solution mentioned in above link to issue https://github.com/nextcloud/all-in-one/issues/2727

@NuclearPhoenixx
Copy link

same here. From 4.3.5 to 4.4.1 on latest nextcloud 25 series.
After the error, when trying to view another page on nextcloud, I was presented with the maintenance screen, telling me that an update was pending. I confirmed to proceed with the update, and everything was resolved

Same here.

Only that after clicking on that "proceed update" button, I got another error, telling me to refresh the website. After doing so, the server is now completely crashed Error 503. Great.

@ChristophWurst

This comment was marked as resolved.

@ChristophWurst

This comment was marked as resolved.

@ChristophWurst
Copy link
Member

#5191 (comment) as a counter example

@ChristophWurst
Copy link
Member

What PHP version do you all use and what are your opcache settings? I could imagine that the old (and faulty) autoloader was still active because opcache didn't clear early enough.

@ChristophWurst
Copy link
Member

The 4.4.1 release does contain an autoloader mapping for

'OCA\\Calendar\\Migration\\Version4004Date20230414163505' => $baseDir . '/lib/Migration/Version4004Date20230414163505.php',

in vendor/composer/autoload_classmap.php.

@solracsf
Copy link
Member Author

solracsf commented Jun 11, 2023

@ChristophWurst opcache.cli is disabled, and app update has been performed on CLI by occ app:update --all.
Using PHP v8.1. Not using apcu either (not even installed).

{
  "reqId": "xivzUkHEkn4kLH2esu1D",
  "level": 3,
  "time": "2023-06-09T22:06:41+02:00",
  "remoteAddr": "",
  "user": "--",
  "app": "app:update",
  "method": "",
  "url": "--",
  "message": "Failure during update of app \"calendar\"",
  "userAgent": "--",
  "version": "25.0.7.1",
  "exception": {
    "Exception": "Exception",
    "Message": "Database error when running migration 4004Date20230414163505 for app calendar\nMigration step 'OCA\\Calendar\\Migration\\Version4004Date20230414163505' is unknown",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/lib/private/legacy/OC_App.php",
        "line": 1008,
        "function": "migrate",
        "class": "OC\\DB\\MigrationService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Installer.php",
        "line": 200,
        "function": "updateApp",
        "class": "OC_App",
        "type": "::",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/core/Command/App/Update.php",
        "line": 107,
        "function": "updateAppstoreApp",
        "class": "OC\\Installer",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php",
        "line": 255,
        "function": "execute",
        "class": "OC\\Core\\Command\\App\\Update",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php",
        "line": 1009,
        "function": "run",
        "class": "Symfony\\Component\\Console\\Command\\Command",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php",
        "line": 273,
        "function": "doRunCommand",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php",
        "line": 149,
        "function": "doRun",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Console/Application.php",
        "line": 214,
        "function": "run",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/console.php",
        "line": 100,
        "function": "run",
        "class": "OC\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/occ",
        "line": 11,
        "args": [
          "/var/www/nextcloud/console.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/DB/MigrationService.php",
    "Line": 420,
    "Previous": {
      "Exception": "InvalidArgumentException",
      "Message": "Migration step 'OCA\\Calendar\\Migration\\Version4004Date20230414163505' is unknown",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/nextcloud/lib/private/DB/MigrationService.php",
          "line": 513,
          "function": "createInstance",
          "class": "OC\\DB\\MigrationService",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/DB/MigrationService.php",
          "line": 416,
          "function": "executeStep",
          "class": "OC\\DB\\MigrationService",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/legacy/OC_App.php",
          "line": 1008,
          "function": "migrate",
          "class": "OC\\DB\\MigrationService",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Installer.php",
          "line": 200,
          "function": "updateApp",
          "class": "OC_App",
          "type": "::",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/core/Command/App/Update.php",
          "line": 107,
          "function": "updateAppstoreApp",
          "class": "OC\\Installer",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php",
          "line": 255,
          "function": "execute",
          "class": "OC\\Core\\Command\\App\\Update",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php",
          "line": 1009,
          "function": "run",
          "class": "Symfony\\Component\\Console\\Command\\Command",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php",
          "line": 273,
          "function": "doRunCommand",
          "class": "Symfony\\Component\\Console\\Application",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php",
          "line": 149,
          "function": "doRun",
          "class": "Symfony\\Component\\Console\\Application",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Console/Application.php",
          "line": 214,
          "function": "run",
          "class": "Symfony\\Component\\Console\\Application",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/console.php",
          "line": 100,
          "function": "run",
          "class": "OC\\Console\\Application",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/occ",
          "line": 11,
          "args": [
            "/var/www/nextcloud/console.php"
          ],
          "function": "require_once"
        }
      ],
      "File": "/var/www/nextcloud/lib/private/DB/MigrationService.php",
      "Line": 498
    },
    "message": "Failure during update of app \"calendar\"",
    "exception": [],
    "CustomMessage": "Failure during update of app \"calendar\""
  },
  "id": "6485eb2000ae9"
}
{
  "reqId": "xivzUkHEkn4kLH2esu1D",
  "level": 3,
  "time": "2023-06-09T22:06:41+02:00",
  "remoteAddr": "",
  "user": "--",
  "app": "PHP",
  "method": "",
  "url": "--",
  "message": "Undefined variable $result at /var/www/nextcloud/core/Command/App/Update.php#117",
  "userAgent": "--",
  "version": "25.0.7.1",
  "exception": {
    "Exception": "Error",
    "Message": "Undefined variable $result at /var/www/nextcloud/core/Command/App/Update.php#117",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/core/Command/App/Update.php",
        "line": 117,
        "function": "onError",
        "class": "OC\\Log\\ErrorHandler",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php",
        "line": 255,
        "function": "execute",
        "class": "OC\\Core\\Command\\App\\Update",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php",
        "line": 1009,
        "function": "run",
        "class": "Symfony\\Component\\Console\\Command\\Command",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php",
        "line": 273,
        "function": "doRunCommand",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php",
        "line": 149,
        "function": "doRun",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Console/Application.php",
        "line": 214,
        "function": "run",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/console.php",
        "line": 100,
        "function": "run",
        "class": "OC\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/occ",
        "line": 11,
        "args": [
          "/var/www/nextcloud/console.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/Log/ErrorHandler.php",
    "Line": 92,
    "CustomMessage": "--"
  },
  "id": "6485eb20009df"
}
{
  "reqId": "xivzUkHEkn4kLH2esu1D",
  "level": 3,
  "time": "2023-06-09T22:06:41+02:00",
  "remoteAddr": "",
  "user": "--",
  "app": "PHP",
  "method": "",
  "url": "--",
  "message": "Undefined variable $result at /var/www/nextcloud/core/Command/App/Update.php#120",
  "userAgent": "--",
  "version": "25.0.7.1",
  "exception": {
    "Exception": "Error",
    "Message": "Undefined variable $result at /var/www/nextcloud/core/Command/App/Update.php#120",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/core/Command/App/Update.php",
        "line": 120,
        "function": "onError",
        "class": "OC\\Log\\ErrorHandler",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php",
        "line": 255,
        "function": "execute",
        "class": "OC\\Core\\Command\\App\\Update",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php",
        "line": 1009,
        "function": "run",
        "class": "Symfony\\Component\\Console\\Command\\Command",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php",
        "line": 273,
        "function": "doRunCommand",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/3rdparty/symfony/console/Application.php",
        "line": 149,
        "function": "doRun",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Console/Application.php",
        "line": 214,
        "function": "run",
        "class": "Symfony\\Component\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/console.php",
        "line": 100,
        "function": "run",
        "class": "OC\\Console\\Application",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/occ",
        "line": 11,
        "args": [
          "/var/www/nextcloud/console.php"
        ],
        "function": "require_once"
      }
    ],
    "File": "/var/www/nextcloud/lib/private/Log/ErrorHandler.php",
    "Line": 92,
    "CustomMessage": "--"
  },
  "id": "6485eb20009bc"
}

@ChristophWurst
Copy link
Member

I was able to trigger it myself with an upgrade from 4.3.0 to 4.4.1

image

The issue is that #5295 fixes the autoloader but the autoloader fix for an upgrade only takes affect for future upgrades. So 4.4.2 or 4.5.0 will be fine only :s

@ChristophWurst
Copy link
Member

ChristophWurst commented Jun 11, 2023

4.4.0 and 4.4.1 removed from https://apps.nextcloud.com/apps/calendar/. Tomorrow I'll

@solracsf solracsf added 2. developing Work in progress and removed 0. to triage Pending approval or rejection labels Jun 11, 2023
@ChristophWurst ChristophWurst self-assigned this Jun 11, 2023
@ChristophWurst ChristophWurst moved this to 🏗️ In progress in 💌 📅 👥 Groupware team Jun 11, 2023
@ChristophWurst
Copy link
Member

The plan to get instances unstuck is as follows

  • Installations of Calendar <=4.3.4 update to v4.3.5, get a fixed autoloader and smooth upgrade in the future
  • Installations of Calendar 4.4.0 should wait for v4.4.2
  • Installations of Calendar v4.4.1 do not need any more fixing can go to v4.4.2
  • The Talk room for appointments feature will return shortly in v4.5, by which I hope instances are on either v4.3.5 or v4.4.2. Unfortunately I can't prevent the bumpy upgrade for instances going from <=4.3.4 to v4.4.x.

Progress is tracked in #5304 (comment).

@flozz
Copy link

flozz commented Jun 12, 2023

I just updated 4.3.4 to 4.3.5 without any issue :)

@ChristophWurst
Copy link
Member

ChristophWurst commented Jun 12, 2023

https://github.com/nextcloud-releases/calendar/releases/tag/v4.4.2 tagged. Release will be built in a few minutes.

I did a prerelease earlier to test the update in a production-like environment with the real app store:

4.3.4->4.4.0 4.3.4->4.4.2
Bildschirmfoto vom 2023-06-12 17-39-39 Bildschirmfoto vom 2023-06-12 18-06-48

I hope this gives everyone a smooth upgrade.

@ChristophWurst ChristophWurst added this to the v4.5.0 milestone Jun 12, 2023
@ChristophWurst
Copy link
Member

A verbose summary of what went wrong: https://help.nextcloud.com/t/post-mortem-analysis-composer-authoritative-classloader/163969

Thanks for the reports and system infos, everyone.

@flozz
Copy link

flozz commented Jun 13, 2023

4.3.5 updated to 4.4.2 flawlessly 👌

@ChristophWurst ChristophWurst added 4. to release Ready to be released and/or waiting for tests to finish and removed 2. developing Work in progress labels Aug 17, 2023
@ChristophWurst
Copy link
Member

This is done. The reverted feature will revive with v4.5.

@github-project-automation github-project-automation bot moved this from 🏗️ In progress to ☑️ Done in 💌 📅 👥 Groupware team Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug
Projects
Development

No branches or pull requests

8 participants