Help! - failure to connect to server after 'git pull upstream master'

I’ve just refreshed my code base with ‘git fetch upstream’ ‘git pull upstream master’. I’m using docker development-easy to run the server on my local desk top. When i try to connect to the server i’m getting a fatal error, implying that the template ‘center’ is missing (i think), and indeed it’s not in the source code folder ‘templates’

the error message is
Fatal error: Uncaught Twig\Error\LoaderError: Unable to find template “center” (looked into: /var/www/localhost/htdocs/openemr/templates). in /var/www/localhost/htdocs/openemr/vendor/twig/twig/src/Loader/FilesystemLoader.php:227 Stack trace: #0 /var/www/localhost/htdocs/openemr/vendor/twig/twig/src/Loader/FilesystemLoader.php(131): Twig\Loader\FilesystemLoader->findTemplate() #1 /var/www/localhost/htdocs/openemr/vendor/twig/twig/src/Environment.php(261): Twig\Loader\FilesystemLoader->getCacheKey() #2 /var/www/localhost/htdocs/openemr/vendor/twig/twig/src/Environment.php(309): Twig\Environment->getTemplateClass() #3 /var/www/localhost/htdocs/openemr/vendor/twig/twig/src/Environment.php(277): Twig\Environment->load() #4 /var/www/localhost/htdocs/openemr/interface/login/login.php(248): Twig\Environment->render() #5 {main} thrown in /var/www/localhost/htdocs/openemr/vendor/twig/twig/src/Loader/FilesystemLoader.php on line 227

hi @ruth , you have to rebuild the dockers, try using the openemr-cmd, it’s simple with openemr-cmd down and openemr-cmd up

Hi Stephen, thanks for your help.

I had used docker-compose down and up, simply. So as you suggested I tried using openemr-cmd, which i think are the same commands but just with the -d or -v flags. now i’m getting the error message
“The connection was reset
The connection to the server was reset while the page was loading.”
I’ve even tried powering down my machine and rebooting!! with the same result.

after I wrote my question I was able to run ok by switching to one of my recent branches, as opposed to running from master, but now even that is giving the same result (after rebuilding the dockers).

so it feels like a much more system level problem…

hi @ruth , it takes 5 to 10 mins for the easy dev installation to complete.

this issue has been created to look into this as well

i wish it were that simple. The error message that i get before the installation has completed is
“Unable to connect
Firefox can’t establish a connection to the server at localhost:8300.” so i don’t think it’s that.

ok, while i was typing that I tried again, now i have a connection but it seems to have reset my sql database, so i can’t log in… so progress of sorts. The tables in the db i looked at, using phpmyadmin, are empty. It’s annoying but not the end of the world as not a live system in any way and i only had test patients and data in it.

Oh, i just looked at the new issue you directed me to. It refers to updated login code, i had noticed that this was a recent modification/PR, and wondered if it was what was causing problems. In london it’s just gone 2pm and i’ve been working solidly all day, so i’m going for a walk to clear my head - when i get back i’ll read through the issue - it looks as though it might be the same thing i’m experiencing - again thanks for your help.

when you do a docker-compose down -v it destroys all of the database and volumes for your dockers. The -v stands for volumes which is why you lost your database tables.

I’m working through this myself and hopefully I don’t have to destroy the volumes, but for your reference in the future if you didn’t know, you can usually do a openemr-cmd bs <snapshot> name and then openemr-cmd gc <snapshot>.tgz to pull the data out before you destroy the volumes. Then an openemr-cmd pc <snapshot.tgz> will copy the snapshot in once you have the docker up and running again. You can then do a openemr-cmd rs <snapshot> to restore the image.


The reason Twig cannot find the template named “center” is that we recently changed how the login page is rendered. Previously, there was a $GLOBAL for the layout of the login page - by default the value was “center.” Now, that value is “login/layouts/vertical_band.html.twig” to point to the actual twig template file.

If upgrading, the value in the database gets corrected when running sql_upgrade.php. If installing a new install, the default values are already good to go.

As others have mentioned, if you are using development-easy docker setup, there are pathways to rebuilding the docker container which should automatically resolve the issue (though I believe that will result in a fresh install [I don’t use the openemr-cmd much so I don’t if you’ll lose your data layer]).

The issue filed on github seems to be a different issue. That involves a directory not being written in the public folder.

1 Like

ah thanks robert - just coincedental then

sorry about that @ruth, should’ve warned you to back up any data first

1 Like

no worries, i had an idea that -v was dangerous, but when i got help for openemr-cmd it said

  -h, --help                         Show the commands usage
  -v, --version                      Show the openemr-cmd command version
  -d                                 Specify the docker id or name to execute commands
  up                                 Execute: docker-compose up -d
  down                               Execute: docker-compose down -v

and i read it too quickly, thinking the -v in the down command was the same as the -v option, my mistake, i should have been more cautious. a learning experience!

1 Like

@stephenwaite I got this same error once I update weno details into global and now login page is not working below is error log

Fatal error : Uncaught Twig\Error\LoaderError: Unable to find template “center” (looked into: C:/xampp/htdocs/riteclinic-openemr/templates). in C:\xampp\htdocs\riteclinic-openemr\vendor\twig\twig\src\Loader\FilesystemLoader.php:227 Stack trace: #0 C:\xampp\htdocs\riteclinic-openemr\vendor\twig\twig\src\Loader\FilesystemLoader.php(131): Twig\Loader\FilesystemLoader->findTemplate(‘center’) #1 C:\xampp\htdocs\riteclinic-openemr\vendor\twig\twig\src\Environment.php(264): Twig\Loader\FilesystemLoader->getCacheKey(‘center’) #2 C:\xampp\htdocs\riteclinic-openemr\vendor\twig\twig\src\Environment.php(312): Twig\Environment->getTemplateClass(‘center’) #3 C:\xampp\htdocs\riteclinic-openemr\vendor\twig\twig\src\Environment.php(280): Twig\Environment->load(‘center’) #4 C:\xampp\htdocs\riteclinic-openemr\interface\login\login.php(248): Twig\Environment->render(‘center’, Array) #5 {main} thrown in C:\xampp\htdocs\riteclinic-openemr\vendor\twig\twig\src\Loader\FilesystemLoader.php on line 227

@stephenwaite its issues regarding the file I had added into openemr from weno patch and once I updated the global it will save the different data for login template therefore issue is there. Weno patch is not not compatible with latest openemr