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

CircularDependencyError messages are opaque #102

Open
nimasmi opened this issue Jan 10, 2022 · 2 comments
Open

CircularDependencyError messages are opaque #102

nimasmi opened this issue Jan 10, 2022 · 2 comments

Comments

@nimasmi
Copy link
Contributor

nimasmi commented Jan 10, 2022

On a large site with multiple links between pages, my users often report failed imports.

The error message is not shown to the user on the destination site at all, see #101.

Even if they were, the logs would be the best place to see these, but the logs only show the latest dependency, the one that raised the issue. Often it looks like:

 File "wagtail_transfer/operations.py", line 462, in run
    self._add_to_operation_order(operation, operation_order, [operation])
  File "wagtail_transfer/operations.py", line 571, in _add_to_operation_order
    self._add_to_operation_order(resolution, operation_order, path + [resolution])
  File "wagtail_transfer/operations.py", line 571, in _add_to_operation_order
    self._add_to_operation_order(resolution, operation_order, path + [resolution])
  File "wagtail_transfer/operations.py", line 567, in _add_to_operation_order
    raise CircularDependencyException()

With Sentry.io, which captures traceback frame context, I can see that the latest dependency is usually a soft one, but the dependency in the preceding frame is a hard one, and not resolvable.

I can also see:

{
    "operation": <wagtail_transfer.operations.CreateTreeModel` object at 0x7fcd5e6d5310>,
    "path" = [
        <wagtail_transfer.operations.CreateTreeModel object at 0x7fcd5ec56650>,
        <wagtail_transfer.operations.CreateTreeModel object at 0x7fcd5ec56150>,
        <wagtail_transfer.operations.CreateTreeModel object at 0x7fcd5e6d5310>,
    ],
    "resolution": <wagtail_transfer.operations.CreateTreeModel object at 0x7fcd5ec56150>,
}

Suggestion: If these objects had more descriptive __str__ methods, I'd have more information about them for debugging, e.g. at

class CreateTreeModel(CreateModel):
.

@jardev
Copy link

jardev commented Aug 10, 2023

@nimasmi did you find the cause for those error message? I'm having this error on random pages sometimes and I can't figure out what is the cause. If I repeat the import process for the same page 2,3 times, sometimes up to 5 times - it gets fixed somehow and the import process ends successfully.

@nimasmi
Copy link
Contributor Author

nimasmi commented Aug 10, 2023

It was typically a page with a rich text link to a child page, or vice versa. It's interesting that repeat attempts seem to have a bulldozer effect.

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

2 participants