Difficulty loading OpenMRS SDK

Good day, I am a new openmrs implementer and has followed all the instructions for installing openmrs 3.5. When it comes to run it on sdk, it takes a long time and then its riddled with errors and then continues at 99% infinitely.

Will love the expert opinion of colleagues at this point

Can you share the error log via pastebin.com?

I am at the verge of giving up installing OpenMRS. The process is unnecesarily difficult. I have spent the last 10/7 and till date zero headway.

I have followed all the instructions from use of of opensdk to use of dockers, all are similar experience.

Do I assume that I may not enjoy openmrs again?

The error you’re getting there is “Access denied”. Normally this happens either when you entered the incorrect credentials for the database user at the start-up.

Your screenshot here seems to be the Docker Compose setup for the RefApp. In our recommended setup, the configuration for the “backend” service looks like this:

backend:
  image: openmrs/openmrs-reference-application-3-backend:${TAG:-qa}
  restart: "unless-stopped"
  depends_on:
    - db
  environment:
    OMRS_CONFIG_MODULE_WEB_ADMIN: "true"
    OMRS_CONFIG_AUTO_UPDATE_DATABASE: "true"
    OMRS_CONFIG_CREATE_TABLES: "true"
    OMRS_CONFIG_CONNECTION_SERVER: db
    OMRS_CONFIG_CONNECTION_DATABASE: openmrs
    OMRS_CONFIG_CONNECTION_USERNAME: ${OMRS_DB_USER:-openmrs}
    OMRS_CONFIG_CONNECTION_PASSWORD: ${OMRS_DB_PASSWORD:-openmrs}
  healthcheck:
    test: ["CMD", "curl", "-f", "http://localhost:8080/openmrs"]
    timeout: 5s
  volumes:
    - openmrs-data:/openmrs/data

And the configuration for the “db” service looks like this:

db:
  image: mariadb:10.11.7
  restart: "unless-stopped"
  command: "mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci"
  healthcheck:
    test: "mysql --user=${OMRS_DB_USER:-openmrs} --password=${OMRS_DB_PASSWORD:-openmrs} --execute \"SHOW DATABASES;\""
    interval: 3s
    timeout: 1s
    retries: 5
  environment:
    MYSQL_DATABASE: openmrs
    MYSQL_USER: ${OMRS_DB_USER:-openmrs}
    MYSQL_PASSWORD: ${OMRS_DB_PASSWORD:-openmrs}
    MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-openmrs}
  volumes:
    - db-data:/var/lib/mysql

The key variables here are OMRS_CONFIG_CONNECTION_USERNAME, OMRS_CONFIG_CONNECTION_PASSWORD, MYSQL_USER, and MYSQL_PASSWORD.

By default the db container will create a database user specified by the MYSQL_USER environment variable with the password passed in the MYSQL_PASSWORD environment variable. In our default configuration, we pass in the OMRS_DB_USER environment variable, either from your command line environment or the .env file in the same directory as the docker-compose.yml file.

Notice that in the backend configuration we also have OMRS_CONFIG_CONNECTION_USERNAME set to the same value as MYSQL_USER and OMRS_CONFIG_CONNECTION_PASSWORD set to the same value as MYSQL_PASSWORD. That way, the backend will be starting up trying to connect to the database with the credentials that the database image setup.

Now, without knowing what your Docker Compose setup looks like, I can’t really tell you what may have gone wrong, but hopefully that should be some hints that could point you in the right direction.

Our community of volunteers here on Talk and our other communication channels usually want to help people get working with OpenMRS, but the best way to get help is to help us help you by explaining as clearly and specifically as you can: what you tried, what isn’t working, what configurations you used (either, e.g., through the installation agent or the docker-compose setup or an SDK command, and any logs or system output you can access. The more specific you can be in your ask for help, the more likely someone will be able to unblock you.

You are also welcome to join our community “Coffee Break” calls that exist to help get live support from community experts and volunteers. The schedule for this can be found on our community calendar at om.rs/cal.

Thank you so much sir. Do I equally need Mariadb installed as well as my database?

I will join as well sir

Well, if you’re using the Docker Compose setup, it includes it’s own MariaDB by default.

If you’re trying to get OpenMRS from Docker to connect to an existing MariaDB instance, that should be possible but it’s slightly more complex. First, you’d have to add an appropriate user and either give that user permission to create databases or create a database in your MariaDB instance. Second, because of the way Docker works localhost generally doesn’t work the way you expect, i.e., each Docker container thinks localhost points only to the services it’s running and not anything else on your computer. To get around this, you’d need to add this stanza to the docker-compose.yml file:

extra_hosts:
    - "host.docker.internal:host-gateway"

And then anywhere you would enter “localhost”, e.g., as the OMRS_CONFIG_CONNECTION_SERVER environment variable, you’d need to put host.docker.internal.

Error log.txt (74.8 KB) kept getting lots of warnings and plenty “unables to load metadata” from maven. In my previous attempts, loads of the modules don’t load after hours of waiting for a complete installation

The logs that you have shared are for mvn openmrs-sdk:setup

Can you also share those for mvn openmrs-sdk:run?

openmrs sdk run log.txt (2.2 MB)

here is it sir still hanging

I have just run the sdk to set up a new instance of O3 using the exact same steps as you have shared above. I got those errors too, but i waited a bit and was able to have the set up finish for log in. You just need to wait a little longer.

Won’t the errors affect the work?

They will not.

I am trying to brand this open page but it has been difficult. Like changing the logo. When I logged in, some modules were not loading like the bedspace management app