OpenEMR 5.0.2 - Site ID is missing from session data!

Situation
Hi everyone, I’m using OpenERM 5.0.2 on iPage hosting provider with PHP Version 7.3.2.
After install, when try to login, the site print the follow error: Site ID is missing from session data!.
I can’t even access the system startup, I only get to the login

To fix it try:

  • Try with many browser (Safari, Chrome, Firedox, Edge, IExplorer), cleaning browser history and cache, don’t work
  • Verify the session.save_path param on the php.ini, don’t work
  • Reinstall, don’t work.

OpenEMR Version
I’m using OpenEMR version 5.0.2

Browser:
I’m using: Chrome, Firefox, Iexplorer, Edge and Safari

Operating System
I’m using Windows, but the installation is on Webhosting on Ipage.com (PHP, MySQL)

I appreciate your help.

Make sure that you are going to the right link.

openemr/interface/login/login.php?site=default

if you have not setup yet, go to the following:

openemr/setup.php

I usually get this error if I am using a bookmark that is set to the following:

openemr/interface/main/tabs/main.php

Dear, the url is /interface/login/login.php?site=default but the error is the same.

I’m wondering if it has something to do with the path. Can you PM me the link?

The path is rme.drss.cl

OK. I was able to get to the log-in screen. Can you get to this point?

1 Like

Yes, I’m loggin in this URL but the error is the same, over and over again

I’m pretty sure that you need to have openemr as part of the link. That could be the issue. You will have to configure your server to have openemr as part of the URL.

you say rme.drss.cl/openemr/my/path ?

It also depends how your globals.php is set up as well. I would have to take time to troubleshoot.

@growlingflea

I’ve been having this issue for a while in my Kubernetes/OpenShift setup. My container of course is read-only, so I’m not sure how to adjust this setting. I know I’ll have to fork the project for these custom edits, but I’m not clear on how to edit the globals.php so that “missing session ID” doesn’t come up anymore.

Any suggestions?

$read_only = empty($sessionAllowWrite);
if (session_status() === PHP_SESSION_NONE) {
//error_log("1. LOCK ".GetCallingScriptName()); // debug start lock
require_once(DIR . “/…/src/Common/Session/SessionUtil.php”);
OpenEMR\Common\Session\SessionUtil::coreSessionStart($web_root, $read_only);
//error_log("2. FREE ".GetCallingScriptName()); // debug unlocked
}

// Set the site ID if required. This must be done before any database
// access is attempted.
if (empty($_SESSION[‘site_id’]) || !empty($_GET[‘site’])) {
if (!empty($_GET[‘site’])) {
$tmp = $_GET[‘site’];
} else {
if (empty($ignoreAuth)) {
// mdsupport - Don’t die if logout menu link is called from expired session.
// Eliminate this code when close method is available for session management.
if ((isset($_GET[‘auth’])) && ($_GET[‘auth’] == “logout”)) {
$GLOBALS[‘login_screen’] = “login_screen.php”;
$srcdir = “…/library”;
require_once("$srcdir/auth.inc");
}
die(“Site ID is missing from session data!”);
}

Have you ever used OpenEMR? Did you complete the setup.php where you created a database?

I have it used OpenEMR before, many times in fact, but I’m using a new deployment method that Red Hat and its parent IBM cooked up last spring when COVID started. Basically, it’s a fast way to deploy OpenEMR as a Kubernetes resource. It works except for this session bug!

You can literally deploy an autoscaling instance of OpenEMR in less than three minutes. It’s terrific!

I wrote the instructions and contributed some bug fixes for my Master’s in Health Informatics thesis last spring.

hi @Ryan_Nix ,
Where is the php session information being stored on your deployment (guessing this is where your issue is stemming from)?

Hi @brady.miller

Well, I took you advice from the Saturday Zoom session last spring, and I forked and edited the php.ini file so the session data, which is commented out in the upstream OpenEMR devops repo, saves to /tmp. Unfortunately, that doesn’t seem to help. Sorry it took so long for me to try this solution, but summer was very busy.

https://raw.githubusercontent.com/ryannix123/openemr-php-ini/master/php.ini

Here is my forked Docker file:

FROM registry.access.redhat.com/ubi8 as builder
RUN dnf update -y
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
RUN dnf install -y  https://rpms.remirepo.net/enterprise/remi-release-8.rpm
RUN dnf install -y yum-utils
RUN dnf module reset -y php
RUN dnf module install -y php:remi-7.3
RUN dnf install -y @php php-mysqlnd php-soap php-gd php-pecl-zip php-ldap wget git npm
RUN wget https://getcomposer.org/installer -O composer-installer.php
RUN wget https://raw.githubusercontent.com/ryannix123/openemr-php-ini/master/php.ini
RUN wget https://raw.githubusercontent.com/openemr/openemr-devops/master/docker/openemr/5.0.2/autoconfig.sh https://raw.githubusercontent.com/openemr/openemr-devops/master/docker/openemr/6.0.0/auto_configure.php
RUN php composer-installer.php --filename=composer --install-dir=/usr/local/bin


RUN git clone https://github.com/openemr/openemr.git --depth 1

WORKDIR openemr
RUN composer install --no-dev
RUN npm install --unsafe-perm \
    && npm run build
RUN composer global require phing/phing \
    && /root/.composer/vendor/bin/phing vendor-clean \
    && /root/.composer/vendor/bin/phing assets-clean \
    && composer global remove phing/phing \
    && composer dump-autoload -o \
    && composer clearcache \
    && npm cache clear --force \
    && rm -fr node_modules
RUN mv sites sites-seed

FROM registry.access.redhat.com/ubi8
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
RUN dnf install -y  https://rpms.remirepo.net/enterprise/remi-release-8.rpm
RUN dnf install -y yum-utils
RUN dnf module reset -y php
RUN dnf module install -y php:remi-7.3
RUN dnf install -y @php php php-mysqlnd php-soap php-gd httpd mod_ssl openssl && dnf clean all
COPY --from=builder /php.ini /etc/php.ini
COPY --from=builder /openemr /var/www/localhost/htdocs/openemr

COPY openemr.conf /etc/httpd/conf.d/openemr.conf
COPY ssl.conf /etc/httpd/conf.d/ssl.conf
COPY first_start.sh /var/www/localhost/htdocs/openemr/
COPY --from=builder autoconfig.sh auto_configure.php /var/www/localhost/htdocs/openemr/
RUN echo "LoadModule mpm_prefork_module modules/mod_mpm_prefork.so" > /etc/httpd/conf.modules.d/00-mpm.conf

# left-over from upstream, do we really need this?
ENV APACHE_LOG_DIR=/var/log/httpd

RUN chmod 0777 /run/httpd
RUN chmod 0770 /var/log/httpd
RUN chown -R apache /var/www/localhost/htdocs/openemr/

RUN sed -i 's/^Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf

WORKDIR /var/www/localhost/htdocs/openemr/
CMD exec /usr/sbin/httpd -D FOREGROUND

EXPOSE 8080 8443

I think @growlingflea might have figuring out the answer to this vexing issue:

hi @Ryan_Nix, would like to test this out, could you help with the instructions please?

do you need to have already created an openshift cluster? not seeing the option to download the command line oc client from the help menu

is it called CodeReady Containers? thank you

ok, guessing
https://docs.openshift.com/container-platform/4.3/cli_reference/openshift_cli/getting-started-cli.html

whoa, 2.2 GB

Hey Stephen,

Yeah, the instructions have probably changed a bit since OpenShift 4 was released. I use Homebrew to obtain the latest oc client, I’m still running OpenShift 3.11, which is fine for my purposes, and Red Hat still updates it with the latest version of Docker, but not Kubernetes. I created my own single-node instance using these instructions: https://github.com/okd-community-install/installcentos Dead simple to do, too.

Another option is to get a free account at OpenShift.com, which you can use for testing.

  • Ryan
1 Like