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

[BUG] Anonymous group, Thredds config page, not working after upgrade from 1.7.3 to 3.5.1 #401

Closed
tlvu opened this issue Mar 25, 2021 · 6 comments · Fixed by #409
Closed
Assignees
Labels
bug Problem, error, or invalid behaviour

Comments

@tlvu
Copy link
Contributor

tlvu commented Mar 25, 2021

Describe the bug
Going here https://lvupavics.ouranos.ca/magpie/ui/groups/anonymous/thredds

Result in this page:
Screenshot_2021-03-25 Magpie-lvupavics-group-anon-thredds

With the following error in docker logs magpie.

[2021-03-25 15:02:18,563] INFO       [ThreadPoolExecutor-0_0][magpie.utils] Request: [GET lvupavics.ouranos.ca:443 /magpie/services/thredds/resources]
[2021-03-25 15:02:18,826] ERROR      [ThreadPoolExecutor-0_0][magpie.ui.utils] Unexpected API error under UI operation. [AttributeError: 'result' object has no attribute 'Resource']
Traceback (most recent call last):
  File "/opt/local/src/magpie/magpie/ui/utils.py", line 121, in wrap
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/pyramid/viewderivers.py", line 436, in rendered_view
    result = view(context, request)
  File "/usr/local/lib/python3.7/site-packages/pyramid/viewderivers.py", line 116, in _class_requestonly_view
    response = getattr(inst, attr)()
  File "/opt/local/src/magpie/magpie/ui/management/views.py", line 751, in edit_group
    info = self.get_remote_resources_info(res_perms, services, session)
  File "/opt/local/src/magpie/magpie/ui/management/views.py", line 808, in get_remote_resources_info
    res_perms = self.merge_remote_resources(res_perms, services, session)
  File "/opt/local/src/magpie/magpie/ui/management/views.py", line 823, in merge_remote_resources
    resources_for_service = merge(res_perms, service_values["service_sync_type"], service_id, session)
  File "/opt/local/src/magpie/magpie/cli/sync_resources.py", line 51, in merge_local_and_remote_resources
    remote_resources = _query_remote_resources_in_database(service_id, session=session)
  File "/opt/local/src/magpie/magpie/cli/sync_resources.py", line 244, in _query_remote_resources_in_database
    tree = get_resource_children(main_resource, session, models.REMOTE_RESOURCE_TREE_SERVICE)
  File "/opt/local/src/magpie/magpie/api/management/resource/resource_utils.py", line 196, in get_resource_children
    tree_struct_dict = tree_service_builder.build_subtree_strut(query)
  File "/usr/local/lib/python3.7/site-packages/ziggurat_foundations/models/services/resource_tree.py", line 76, in build_subtree_strut
    return self.service.build_subtree_strut(result=result, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/ziggurat_foundations/models/services/resource_tree_postgres.py", line 152, in build_subtree_strut
    new_elem = {"node": node.Resource, "children": OrderedDict()}
AttributeError: 'result' object has no attribute 'Resource'
[2021-03-25 15:02:18,839] INFO       [ThreadPoolExecutor-0_0][magpie.utils] Request: [POST lvupavics.ouranos.ca:443 /magpie/ui/error]

Note that the Jenkins test suite actually passed on that instance after the upgrade: https://daccs-jenkins.crim.ca/job/PAVICS-e2e-workflow-tests/job/master/239/console

Also when the magpie container was recreated at the moment of the upgrade, there was no error related to DB migration.

To Reproduce
Steps to reproduce the behavior:
My dev server autodeployed the PR bird-house/birdhouse-deploy#107

Expected behavior
Being able to see the permissions for Thredds for the anonymous group.

@tlvu tlvu added the bug Problem, error, or invalid behaviour label Mar 25, 2021
@fmigneault
Copy link
Collaborator

@tlvu
Can you create an admin user (or provide this instance's admin user credentials)?
I cannot view definitions from it without admin access.

@tlvu
Copy link
Contributor Author

tlvu commented Mar 25, 2021

@tlvu
Can you create an admin user (or provide this instance's admin user credentials)?
I cannot view definitions from it without admin access.

Provided via private messaging.

@fmigneault
Copy link
Collaborator

@tlvu
Is it possible to obtain a data dump of the db by private message?
Using the same endpoint and config on a local instance doesn't cause the problem.
Must be tightly related to the 'remote' resources for which actual data must exist to do the sync.

@tlvu
Copy link
Contributor Author

tlvu commented Mar 26, 2021

@tlvu
Is it possible to obtain a data dump of the db by private message?
Using the same endpoint and config on a local instance doesn't cause the problem.
Must be tightly related to the 'remote' resources for which actual data must exist to do the sync.

Provided tarball of /data/magpie_persist via private messaging.

@fmigneault
Copy link
Collaborator

@tlvu
My bad. I meant a DB snapshot before migration with magpie data similar to pavics/medus.
The error log is very specific to 'remote' resources, which depends on sync with thredds directories of actual data.

@tlvu
Copy link
Contributor Author

tlvu commented Mar 26, 2021

@tlvu
My bad. I meant a DB snapshot before migration with magpie data similar to pavics/medus.
The error log is very specific to 'remote' resources, which depends on sync with thredds directories of actual data.

@fmigneault Sorry I do not have the state before the migration since the new broken Magpie was autodeployed directly on my dev VM the moment that PR was merged. Normally, PR is merged only after throughout testing so that has never been an issue before.

tlvu added a commit to bird-house/birdhouse-deploy that referenced this issue Mar 26, 2021
Revert "Merge pull request #107 from bird-house/magpie-thredds"

This reverts commit 7be3eea, reversing changes made to c0ffb41.

PR #107 upgrade path is unstable, see issue Ouranosinc/Magpie#403 and issue Ouranosinc/Magpie#401.

Revert so we can remove the autodeploy block on production instances and give us time to properly test any upcoming fixes.  Also unblock Finch to go to production #138.

Branch https://github.com/bird-house/birdhouse-deploy/tree/restore-previous-broken-magpie-upgrade-so-we-can-work-on-a-fix created so we have a place to work on a fix.

Matching notebooks revert: Ouranosinc/pavics-sdi#211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Problem, error, or invalid behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants