edgedb-cli icon indicating copy to clipboard operation
edgedb-cli copied to clipboard

Upgrades to 2.0 sometimes fail on Apple Silicon hardware with x86_64 builds

Open jfeiwell opened this issue 3 years ago • 13 comments

  • EdgeDB Version: 1.4 trying to upgrade to 2.0
  • OS Version: Monterey (M1)

Steps to Reproduce:

Pic attached of entire issue

Screen Shot 2022-07-28 at 2 49 26 PM

Schema:

jfeiwell avatar Jul 28 '22 19:07 jfeiwell

To just clarity: this project is linked to a remote instance?

The short answer is that the CLI just isn't capable of upgrading remote instances right now. We'll follow up here once we have a proper remote upgrade guide — soon!

colinhacks avatar Jul 28 '22 19:07 colinhacks

for remote instances the upgrade procedure is

  1. create a new remote instance using EdgeDB 2.0
  2. edgedb dump -I old_instance mydumfile
  3. edgedb restore -I new_instance mydumpfile

fmoor avatar Jul 28 '22 20:07 fmoor

The original error message seems to suggest the CLi failed to upgrade a local instance and now wrongly thinks it's a remote instance.

@jfeiwell, can you try edgedb instance revert "ag_0528" and try the upgrade again?

elprans avatar Jul 28 '22 20:07 elprans

So that worked to get the instance running locally. When I try to upgrade this is what I get

Upgrading to a major version 2.0+88c1706 Version 2.0+88c1706 is already installed Dumping the database... edgedb error: ClientConnectionFailedError: cannot establish connection for 30s: Connection refused (os error 61)

jfeiwell avatar Jul 28 '22 20:07 jfeiwell

Can you successfully create a fresh 2.0 instance?

elprans avatar Jul 28 '22 21:07 elprans

edgedb error: Project is already initialized.

I can in a new directory if that's helpful, and it says 2.0 already installed

I tried again and got this new error edgedb project upgrade --to-latest Upgrading to a major version 2.0+88c1706 Version 2.0+88c1706 is already installed Dumping the database... edgedb error: Upgrade is already in progress

jfeiwell avatar Jul 28 '22 21:07 jfeiwell

A new directory. I'm wondering if the 2.0 build is crashing on your machine for some reason.

Also, please do the edgedb instance revert and try the upgrade again with env RUST_LOG=debug and post output if possible.

elprans avatar Jul 28 '22 22:07 elprans

It works with a new directory.

I run the project upgrade and it makes the instance inactive and gives that in progress error. I run instance start and it's running again but get same error. When I run revert it says edgedb error: cannot find backup directory to revert

jfeiwell avatar Jul 28 '22 22:07 jfeiwell

@jfeiwell and I diagnosed this via Discord and it appears that Postgres 14 hangs at bootstrap time. Switching to the native arm64 build resolved the issue.

For reference, here's how one can currently upgrade to native Apple Silicon builds:

Step 1: reinstall the CLI: curl --proto '=https' --tlsv1.2 -sSf https://sh.edgedb.com | sh Step 2: remove the previously downloaded x86 build of EdgeDB 2.0 (edgedb server uninstall --version "2.0")

I'll leave this issue open in case others bump into this.

elprans avatar Jul 28 '22 23:07 elprans

@elprans @tailhook Paul, we should automatically update the CLI to native m1 build.

1st1 avatar Jul 29 '22 00:07 1st1

@elprans @tailhook Paul, we should automatically update the CLI to native m1 build.

The hardest part here is not updating CLI to native m1 build but upgrading server to the native m1 build.

Is postgres' data directory compatible between x86 and m1 build?

tailhook avatar Jul 29 '22 10:07 tailhook

@elprans @tailhook Paul, we should automatically update the CLI to native m1 build.

The hardest part here is not updating CLI to native m1 build but upgrading server to the native m1 build.

On the other hand, if CLI is updated before upgrading server it should install new version in arm64 and regular upgrade should work. So probably I was overthinking it a bit.

tailhook avatar Jul 29 '22 13:07 tailhook

it should install new version in arm64 and regular upgrade should work

Yes

elprans avatar Jul 29 '22 19:07 elprans

This should have been fixed.

tailhook avatar Sep 09 '22 15:09 tailhook