webiny / webiny-js

Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
https://www.webiny.com
Other
7.4k stars 614 forks source link

Form Builder installation error: The requested upgrade version does not match the deployed version #1676

Closed ceefour closed 3 years ago

ceefour commented 3 years ago

Form Builder installation error: The requested upgrade version does not match the deployed version

This is:

Specifications

Expected Behavior

Installs successfully.

Actual Behavior

During "Form Builder", first it gets stuck for a long time. (see below for possible explanation)

Then after refreshing, it now shows:

Upgrade Form Builder

This upgrade will do the following:

  • insert Elasticsearch records into a dedicated DynamoDB table

but then shows error: "The requested upgrade version does not match the deployed version"

image

Repeating will have same result.

Steps to Reproduce the Problem

  1. Install webiny
  2. dev environment
  3. Region: ap-southeast-1
  4. Choose locale id-ID

Detailed Description

I used Network tab to see the graphql:

Request:

[
  {
    "operationName": "UpgradeFormBuilder",
    "variables": { "version": "5.0.0" },
    "query": "mutation UpgradeFormBuilder($version: String!) {\n  formBuilder {\n    upgrade(version: $version) {\n      data\n      error {\n        code\n        message\n        data\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n"
  }
]

Response:

[
  {
    "data": {
      "formBuilder": {
        "upgrade": {
          "data": null,
          "error": {
            "code": "UPGRADE_VERSION_MISMATCH",
            "message": "The requested upgrade version does not match the deployed version.",
            "data": {
              "deployedVersion": "5.7.0",
              "requestedUpgradeTo": "5.0.0"
            },
            "__typename": "FbError"
          },
          "__typename": "FbBooleanResponse"
        },
        "__typename": "FbMutation"
      }
    },
    "extensions": { "console": [] }
  }
]

And the initial "stuck installation of Form Builder" is likely caused by timed out invocation: (using Lumigo)

image

Possible Solution

Pavel910 commented 3 years ago

@ceefour was this an upgrade from some previous version of Webiny or a fresh project?

ceefour commented 3 years ago

No it's a fresh project.

Now I'm trying:

yarn webiny destroy api --env=dev
# above was successful

# currently doing this, which will take a long time again esp. Elasticsearch ..........
yarn webiny deploy api --env=dev --debug
ceefour commented 3 years ago

What's weird is that Form Builder seems to request an "upgrade" from 5.7.0 to 5.0.0 ?

ceefour commented 3 years ago

I also want to report a UI bug because the "The requested upgrade version does not match the deployed version" message is only shown in the UI for like 1 second and disappears immediately, without any dialog box or OK button.

That's why I had to go to Network tab in order to see the real message.

Pavel910 commented 3 years ago

Did you encounter this error on localhost:3001 or on a deployed admin app, with CDN URL ?

If it was on localhost, have you ever had another Webiny project started locally before?

(no upgrade should ever be triggered on fresh projects, but there is a possibility that a previous project left the previous version stored in localStorage, which can cause confusion on localhost)

ceefour commented 3 years ago

No this is live on AWS.

I am not even aware that I can develop locally ;-)

Pavel910 commented 3 years ago

@ceefour in that case it's very weird. If it's a deployed admin app, there's no chance there's a clash with localStorage (at least we eliminated that possibility).

Can't give you any answer at this point πŸ€”

And yes, you can develop React stuff locally. API has to be deployed, but React is your regular local app: https://www.webiny.com/docs/how-to-guides/webiny-cli/use-watch-command/

ceefour commented 3 years ago

Here's my workaround to resolve it:

yarn webiny destroy api --env=dev --debug
yarn webiny deploy api --env=dev --debug

# Trying to access admin app will now cause error due to Cognito something, so I had to:
yarn webiny destroy apps/admin --env=dev --debug
yarn webiny deploy apps/admin --env=dev --debug

Then I opened the admin app URL, and clearing browser site data (not sure if this is necessary, because the admin URL is fresh from cloudfront).

Now it works again.

I may never know what exactly caused the first issue, but my hunches, a combination of one or more:

  1. Lambda cold start
  2. Elasticsearch is doing some background process which caused GraphQL function to be slow and therefore exceeded 30 second limit
Pavel910 commented 3 years ago

Definitely something to debug, and hopefully we manage to reproduce. I need to try to replicate the issue with broken installation.... I think it only happens if installation is broken due to a timeout, and some variables are not properly handled.

Anyhow, thanks for reporting. This is very unusual and we'll try to debug.

ceefour commented 3 years ago

Thanks for trying to help. Feel free to close this issue if you want.

However, the discussion above may be useful for someone getting similar issue as mine, as when I searched for the error message keywords, there's no existing issue.


One more thing: You mentioned Lumigo in your application stack. I think you (as Webiny company) should partner or become affiliate of Lumigo. Because Webiny apps will likely need a monitoring solution as you already aware by mentioning Lumigo. If you can get commission by helping Lumigo sales, that will be good for both of your companies. Since both Webiny and Lumigo promote serverless infrastructure, and perfectly complement each other (not competitive).

Same goes with Pulumi.

We now use Pulumi in other non-Webiny project, because Webiny uses Pulumi. :-) Seriously: https://about.lovia.life/docs/infrastructure/pulumi/

Pavel910 commented 3 years ago

I won't be closing this issue, as it is something to look into.

I'm glad you were not thrown off by Pulumi. We love it and we're glad you like it too 🍻

We're cooking some partnerships already ;) Announcements coming in the near future! :)

ceefour commented 3 years ago

Oh and thank you creating and releasing high quality software like Webiny as open source. πŸ₯‡

I hope you get sustained business model and help businesses to grow, so when we grow we can be your paying customers as well.

Pavel910 commented 3 years ago

Thank you! Much appreciated πŸš€ πŸ™Œ

P.S. Join our slack community and don't hesitate to post questions there when you need help with Webiny. We're hanging out there throughout the day :)

ceefour commented 3 years ago

Is there a page to post "documentation request" ? Or is it in this GitHub tracker too?

I'd like to request documentation on how to configure custom Elasticsearch to replace AWS's. So the developer has choice.

For example, Elastic Cloud Basic starts at $16/mo so it can be a more affordable option for startups. Or perhaps self-hosted Elasticsearch.

Update: I think it's because v5 is sooo new that you haven't had chance to put more docs?

Pavel910 commented 3 years ago

Docs have a separate repo: https://github.com/webiny/docs.webiny.com/

Please do open an issue there. One other user already did have your requirement, and I know I tested it with Elastic Cloud, and it worked just fine. Just shoot us an issue and we'll try to get it sorted as soon as we can.

We're a very small team, and we just don't have enough hands to both cover everything with docs AND develop new features, improve the platform, etc. We're currently hiring new engineers 🀞

Btw. by the end of Summer, we plan to have a DynamoDB-only version of storage layer, to avoid using Elasticsearch for small projects and local development entirely.

webiny-bot commented 3 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.