Issues upgrading 5.0.15 to 5.1.0
# support
b
I am trying to update dfrom the versions indicated and get the following message: Error: Unable to run this version of Medplum server. Pending post-deploy migration v31 requires server at version 5.0.0 <= version < 5.1.0, but current server version is 5.1.0 Eventually the container dies and attempts to restart. 5.0.15 should be the last version on 5.0. So I am not sure what is going wrong.
c
Hi @Brian Hirst - just to confirm, you're trying to deploy version 5.0.15 and getting that error message? Are you on AWS? Or other cloud? How are you setting Medplum server version? CDK? Or other?
b
I am on AWS and using the CDK.
c
what is the
serverImage
string in your Medplum CDK config JSON? i.e., something like this:
Copy code
"serverImage": "medplum/medplum-server:latest",
If using the
:latest
tag, you will need to change to an explicit version tag such as
5.0.15
to ensure you're deploying that specific version. If you're already doing that, then we'll need to dig into the logs to figure out what's going on.
b
We call out the specific version. Working we are at "image": "medplum/medplum-server:5.0.15", when I update that to "image": "medplum/medplum-server:5.1.0", you get the error message above.
The above references the Task Definition in ECS. The line in the config file: Healthy:
"serverImage": "medplum/medplum-server:5.0.15",
Broken:
"serverImage": "medplum/medplum-server:5.1.0",
@cody anything you want me to hunt down to move this forward?
c
Ah, ok, got it. Sorry, I misunderstood earlier. Ok, so once you deploy the
5.0.15
, can you log in as a super administrator, and run pending data migrations? The data migrations run automatically by default. Either the data migrations were disabled, or a data migration failed. Do you see any failed migrations? https://cdn.discordapp.com/attachments/1486108048765227028/1489093015455793322/image.png?ex=69cf2970&is=69cdd7f0&hm=7912204502492c13969d1bedeed64696ab381c5f71d71d49bed90e69f0ec16e9&
c
Thanks. Investigating.
n
c
Ok, data migration 31 was a "Rebuild Value Sets" migration. That means it didn't do anything too complex, it was routine maintenance to update
CodeSystem
and
ValueSet
resources. See here: https://github.com/medplum/medplum/blob/main/packages/server/src/migrations/data/v31.ts
Ah! Nice catch @nathan-watkins-unityai ! @Brian Hirst - is it possible the "R4" project was deleted?
b
This is our dev system, so its entirely possible. I'll ask, but it may take until next week to get an answer.
My team doesn't recall any project called R4, one asked about a Spec, but nothing any of them can recall, and nothing automated in our app would have created it. Any way we can clear this migration and let it re-run?
n
I'm just a fellow Medplum self-hoster but highly suspect
Project/161452d9-43b7-5c29-aa7b-c85680fa45c6
has been deleted. Medplum creates 2 projects on startup, Super Admin and FHIR R4. All of the base StructureDefinitions, CodeSystems, ValueSets, and SearchParameters live in this project and are shared by all other projects([1](https://github.com/medplum/medplum/blob/2436edcd9a303306e6b80c5e1eb2e0bcba6d4baf/packages/server/src/constants.ts#L19)) ([2](https://github.com/medplum/medplum/blob/2436edcd9a303306e6b80c5e1eb2e0bcba6d4baf/packages/server/src/fhir/repo.ts#L317)). I'm not sure all of the repercussions of deleting it but it's definitely coloring outside the lines. Medplum has docs on [restoring data](https://www.medplum.com/docs/fhir-datastore/deleting-data#restoring-data). I think you can technically [skip data migrations](https://discord.com/channels/905144809105260605/1435933404507144234/1436113976713805896). No idea how bad of an idea that is.
b
Sounds like you are right and I can confirm this environment doesn't have a FHIR R4 project. So I will go down the restore process. It's likely been gone a long time, but I will post when I have news.
n
The fact that the entire environment isn't completely broken makes me think it could be as simple as navigating to
<your-medplum-app.com>/Project/161452d9-43b7-5c29-aa7b-c85680fa45c6
as a super admin and clicking the restore button
b
Ok, the restore worked, the broken job ran successfully, I upgraded to 5.1.0 without an issue, so I think this is all resolved. Never delete the FHIR R4 or Super Admin project added to docs! 🙂 Thank you for the help!
27 Views