Do you use or administer OpenEMR? Take the General Satisfaction Survey to help improve the product

Error trying to register Smart APP after Patch

I updated my ec2 instance with the latest code from master and I get this error now when trying to register a smart app via the /interface/smart/register-app.php

Query Error
ERROR: query failed: SELECT `id` FROM `insurance_companies` WHERE `uuid` IS NULL OR `uuid` = '' OR `uuid` = '' LIMIT 1000

Error: Unknown column 'uuid' in 'where clause'

/var/www/localhost/htdocs/openemr/src/Common/Uuid/UuidRegistry.php at 216:sqlStatementNoLog
/var/www/localhost/htdocs/openemr/src/Services/InsuranceCompanyService.php at 38:createMissingUuids()
/var/www/localhost/htdocs/openemr/src/Services/OrganizationService.php at 29:__construct()
/var/www/localhost/htdocs/openemr/src/Services/FHIR/FhirOrganizationService.php at 33:__construct()
/var/www/localhost/htdocs/openemr/src/RestControllers/RestControllerHelper.php at 285:__construct()
/var/www/localhost/htdocs/openemr/src/Common/Auth/OpenIDConnect/Repositories/ScopeRepository.php at 618:getCapabilityRESTObject(Array)
/var/www/localhost/htdocs/openemr/interface/smart/register-app.php at 58:getCurrentSmartScopes()

Prior to this, I had already patched it to 6.0.1.

I have no insurance companies in my database, any ideas on how to resolve this?


@benmarte have you tried upgrading your database? That looks like an error I’ve seen when the database upgrade script hasn’t run and there is a new column in the database.

@adunsulag how do I do that? :rofl:

run sql_upgrade.php from browser.
ie http://localhost/openemr/sql_upgrade.php or whatever is your site url.

@sjpadgett I get a 404 when I hit that URL, any other ideas?


umm don’t use that exact url. It’s an example.
Use https://{domain}/{your sitedirpath}/sql_upgrade.php

Neither https://{domain}/openemr/sql_upgrade.php nor https://{domain}/sql_upgrade.php yield anything besides a 404 :eyes:

use the same url domain you use to access your site i.e replace your domain where {domain}
Just use your site url minus the interface/index.php replaced with sql_upgrade.php…

@sjpadgett I’m just masking the domain name :rofl: but yes none of those do anything.

Do I have to upload that file? because it does not exist on my EC2 instance. Gonna yolo it :upside_down_face: and find out :rofl:

Yup that did it thanks guys :raised_hands:

And folks wonder why I don’t use AWS and docker.

LOL it’s amazing @sjpadgett come join the darkside :rofl:

Thanks for you help again :pray:

have heard that aws is amazon’s most profitable enterprise; always good to have a backup that can be turned on locally or globally whatever the case may be

there’s a nice upgrade script that Asher put together for pulling the files that are not in the aws packages

1 Like

If you’ve setup the OpenEMR cli tools you can run
openemr-cmd dri to reset the database and run any upgrades

or openemr-cmd drid to reset the database, run upgrades, and install demo data.

This works on the docker installations.