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

FatalThrowableError on first contenttype with a relation when running app/nut database:export #7811

Closed
doenietzomoeilijk opened this issue Oct 14, 2019 · 2 comments

Comments

@doenietzomoeilijk
Copy link

While migrating a site from sqlite to a mysql backend, I wanted to export the data in the sqlite database to an export file, as I've done before. However, that now results in a fatal error.

Details

Question Answer
Relevant Bolt Version 3.6.10, ran composer update on both Bolt and the extensions.
Install type composer
BC Break n/a
PHP version 7.3.10 (homebrew)
Web server n/a, CLI

Reproduction

If you're filing a bug, please describe how to reproduce it. Include as much
relevant information as possible, such as:

Bug summary

Error message:

Call to a member function getContenttype() on null

in LazyCollection.php line 24
at LazyCollection->serialize() in Export.php line 158
at Export->addRecord(object(MutableBag), object(ClassMetadata), object(Content)) in Export.php line 130
at Export->getRecords('themes', object(MutableBag), object(MutableBag)) in Export.php line 67
at Export->run(array('themes', 'subjects', 'publications', 'events', 'newsletters', 'wizards', 'wizard_steps', 'referrals', 'specialists', 'homepage', 'pages', 'blocks'), object(MutableBag), false) in DatabaseExport.php line 62
at DatabaseExport->execute(object(ArgvInput), object(ConsoleOutput)) in Command.php line 245
at Command->run(object(ArgvInput), object(ConsoleOutput)) in Application.php line 853
at Application->doRunCommand(object(DatabaseExport), object(ArgvInput), object(ConsoleOutput)) in Application.php line 185
at Application->doRun(object(ArgvInput), object(ConsoleOutput)) in Application.php line 117
at Application->run() in nut line 19```

From what I can tell from the dump, stuff goes pear-shaped on the first record of the first contenttype (`themes` in this case), right after the regular fields have been figured out and the script starts working on the relations.

### Steps to reproduce

Run `php app/nut database:export -d dbdump/ -n`.

### Expected result

A bunch of files in `dbdump/`.

### Actual result

Failure, despair, destruction raining left and right.

- - -

I'll try to make some time to do a bit more digging after this site has seen its release.
@doenietzomoeilijk
Copy link
Author

@SahAssar chipped in and mentioned it might be about relations. I had the same suspecion, since relations was the last field the exporter encountered before bombing. In the same project, after removing relations for the first few contenttypes, the export does indeed run, until it encounters the first contenttype with relations.

@doenietzomoeilijk doenietzomoeilijk changed the title FatalThrowableError when running app/nut database:export FatalThrowableError on first contenttype with a relation when running app/nut database:export Oct 16, 2019
@doenietzomoeilijk
Copy link
Author

This was fixed by #7812 .

Now there's a separate RFC for how to handle select exports/imports, see #7817 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant