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

The mongo data has been tampered after snap update. #83

Closed
abel533 opened this issue Mar 1, 2019 · 32 comments
Closed

The mongo data has been tampered after snap update. #83

abel533 opened this issue Mar 1, 2019 · 32 comments
Labels

Comments

@abel533
Copy link

abel533 commented Mar 1, 2019

You may find that the card has disappeared.

Query the mongo database to find the following problem:

    "listId" : "PozTHYqCX9P5TcchW",
    "boardId" : "rjkgvdzfSwo5MC7qW",
    "sort" : 0.0625,
    "swimlaneId" : "rjkgvdzfSwo5MC7qW",
    "type" : "cardType-card",
    "archived" : false,

the swimlaneId should be 6zoz9hutLm9T4h7Rz,but now it's the same as boardId, then the card has disappeared.

Snap can't disable updates, how to avoid this serious bug caused by automatic updates.

@abel533 abel533 changed the title The mongo data has been tampered with after snap update. The mongo data has been tampered after snap update. Mar 1, 2019
@xet7
Copy link
Member

xet7 commented Mar 1, 2019

@abel533

What is your Wekan versions? You see it with sudo snap list

Docker version of Wekan does not update automatically, it's used by version tag like this at docker-compose.yml:

image: quay.io/wekan/wekan:v2.33

With Wekan, you need to have backups of database at least daily, preferably more often. Wekan still has bugs that can make Wekan board not load anymore, like moving some card away from subtasks, or linking to card itself causing recursive loop, so you need to be able to restore, even when not having automatic updates.

@andresmanelli Can you look at this?

Related wekan/wekan#2209

@xet7 xet7 added the bug label Mar 1, 2019
@xet7
Copy link
Member

xet7 commented Mar 1, 2019

Hmm, that's stange bug. I'll also look at source code changes how has this happened.

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

@abel533

I can't figure out anything that would cause that in changes between previous and newest Wekan release that would have caused that. It would really help if you could tell what Wekan version you have.

@abel533
Copy link
Author

abel533 commented Mar 1, 2019

Version:

Name   Version    Rev   Tracking  Publisher   Notes
core   16-2.37.2  6405  stable    canonical✓  core
wekan  2.33       449   stable    xet7        -

When you add or modify a card now, there will still be a problem with the swimlaneId becoming a boardId.

image

@abel533
Copy link
Author

abel533 commented Mar 1, 2019

How to use the snap to downgrade the wekan version?

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

@abel533

https://snapcraft.io has snap docs.

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

Just guessing, maybe it's this wekan/wekan#2213

I will revert it and add new Wekan release.

xet7 added a commit to wekan/wekan that referenced this issue Mar 1, 2019
[mongodb data tampered](wekan/wekan-snap#83).

Thanks to xet7 !
@abel533
Copy link
Author

abel533 commented Mar 1, 2019

I also found filtering problems yesterday.

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

Wekan Snap version is currently building, it will be released soon.

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

Well, "soon" depends how fast Snap Store validates new upload of Wekan release. Sometimes it's fast, but sometimes it takes one hour.

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

@abel533

Thanks a lot for reporting this issue! Hmm, I did not sleep tonight, it's morning already...

@abel533
Copy link
Author

abel533 commented Mar 1, 2019

I will always pay attention to the update of the snap version, and feedback after the update.

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

Thanks! Wekan has a huge amount of advanced features so I do depend on bug reports etc community feedback to know what does not work.

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

Now Wekan snap is released! Please test. This updates immediately:

sudo snap refresh

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

Only other change that I did not revert yet were performance improvements wekan/wekan#2214 that add indexes to MongoDB and do group queries to database, but I would think that does not actually change queries in any way.

@abel533
Copy link
Author

abel533 commented Mar 1, 2019

I have updated.

@abel533
Copy link
Author

abel533 commented Mar 1, 2019

Filtering problems still exist

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

Sure, filter "fix" was reverted. But did mongodb tampering get fixed?

@abel533
Copy link
Author

abel533 commented Mar 1, 2019

SwimlaneId problem still exists, I'll try a lower version.

@abel533
Copy link
Author

abel533 commented Mar 1, 2019

redis@redis:~$ sudo snap revert --revision=446 wekan
wekan reverted to 2.31
redis@redis:~$ ll /snap/wekan/
total 8
drwxr-xr-x  5 root root 4096 Mar  1 14:34 ./
drwxr-xr-x  5 root root 4096 Jan 10 09:47 ../
drwxr-xr-x 13 root root  671 Feb 28 18:57 446/
drwxr-xr-x 13 root root  671 Mar  1 05:47 449/
drwxr-xr-x 13 root root  671 Mar  1 13:25 451/
lrwxrwxrwx  1 root root    3 Mar  1 14:34 current -> 446/

@abel533
Copy link
Author

abel533 commented Mar 1, 2019

redis@redis:~$ snap list --all wekan
Name   Version  Rev  Tracking  Publisher  Notes
wekan  2.31     446  stable    xet7       -
wekan  2.33     449  stable    xet7       disabled
wekan  2.34     451  stable    xet7       disabled

446 also has problems. I can't switch to a lower version.

@bentiss
Copy link

bentiss commented Mar 1, 2019

446 also has problems. I can't switch to a lower version.

I can help bisecting the problem. However, I can't seem to reproduce the issue. Do you have a reliable reproducer? Neither adding nor modifying a card makes it disappear in v2.33, so I must not be doing the right thing to expose the bug.

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

@abel533

You could have something wrong in your database like circular reference bug or something else. It can not be fixed with downgrade because downgrade does not change database contents. You coud try exporting all boards to Wekan JSON and importing to new empty Wekan database. You can empty database this way in snap:

sudo snap stop wekan.wekan
mongo --port 27019
use wekan
db.dropDatabase();
exit
sudo snap start wekan.wekan

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

And, make backup first before trying above.

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

Also, this does not restore all users, so you would need to copy list from webbrowser and create them again, or edit database.

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

Another one to try is, does this bug happen only on one board? If you create new board, is the bug there too?

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

I would guess that if you find the difference by comparing working and not-working Wekan boards, and fix some small change to your existing database, you could fix this.

@xet7
Copy link
Member

xet7 commented Mar 1, 2019

Also on my Wekan boards I have not noticed this bug at all. I will add filter fix back in next Wekan release.

@abel533
Copy link
Author

abel533 commented Mar 2, 2019

This problem exists in many billboards.

When this problem occurs again, I will check all the data to find the problem.

@abel533
Copy link
Author

abel533 commented Mar 2, 2019

Test in a new board.

Create a new card and drag it in the current list.

The following are the new and updated messages:

[
  [
    {
      "msg": "method",
      "method": "/cards/insert",
      "params": [
        {
          "title": "111",
          "members": [],
          "labelIds": [],
          "customFields": [],
          "listId": "FmAiv5rD3spesKK5f",
          "boardId": "7qBtoFy5iD9jEPj2T",
          "sort": 3,
          "swimlaneId": "xtTDXEpP9q4tjJxAb",
          "type": "cardType-card",
          "archived": false,
          "parentId": "",
          "coverId": "",
          "createdAt": { "$date": 1551506948812 },
          "dateLastActivity": { "$date": 1551506948812 },
          "description": "",
          "requestedBy": "",
          "assignedBy": "",
          "spentTime": 0,
          "isOvertime": false,
          "userId": "oup6ydF2SXPsZXa3X",
          "subtaskSort": -1,
          "linkedId": ""
        }
      ],
      "id": "30",
      "randomSeed": "e3df1685305781720f82"
    }
  ],
  [
    {
      "msg": "method",
      "method": "/cards/update",
      "params": [
        { "_id": "Q9bhk3pSQLteKSALW" },
        {
          "$set": {
            "swimlaneId": "7qBtoFy5iD9jEPj2T",
            "listId": "FmAiv5rD3spesKK5f",
            "boardId": "7qBtoFy5iD9jEPj2T",
            "sort": 3,
            "dateLastActivity": { "$date": 1551506950810 }
          }
        },
        {}
      ],
      "id": "31"
    }
  ]
]

Tests show that only specific users will update the wrong swimlaneId. My own account does not have this problem. Can you see the reason?

@abel533
Copy link
Author

abel533 commented Mar 2, 2019

docker compose, use wekanteam/wekan:v2.17.

The same user performs the same operation.

There is no problem with this version. Judging from the data, swimlaneId has been updated in the new version.

{
    "msg": "method",
    "method": "/cards/update",
    "params": [
        {
            "_id": "JeFGz88Ykt9aeXe5m"
        },
        {
            "$set": {
                "listId": "gSQcK4AyA3K3A9hpc",
                "boardId": "QEvKyvvi69yaentZo",
                "sort": 4,
                "dateLastActivity": {
                    "$date": 1551513769979
                }
            }
        },
        {}
    ],
    "id": "5"
}

@abel533
Copy link
Author

abel533 commented Mar 2, 2019

I changed from snap to dock-compose.

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

No branches or pull requests

3 participants