Error
Call to a member function getGeoData() on null Error thrown with message "Call to a member function getGeoData() on null" Stacktrace: #8 Error in /var/www/app/Services/Region/SelectRegionService.php:104 #7 App\Services\Region\SelectRegionService:getUserRegionByIP in /var/www/app/Services/Region/SelectRegionService.php:86 #6 App\Services\Region\SelectRegionService:getRegionName in /var/www/html/local/templates/main/header.php:22 #5 include_once in /var/www/html/bitrix/modules/main/include/prolog_after.php:106 #4 require in /var/www/html/bitrix/modules/main/include/prolog.php:11 #3 require_once in /var/www/html/bitrix/header.php:1 #2 require in /var/www/html/press_releases/index.php:8 #1 include_once in /var/www/html/bitrix/modules/main/include/urlrewrite.php:159 #0 include_once in /var/www/html/bitrix/urlrewrite.php:2
Stack frames (9)
8
Error
/app/Services/Region/SelectRegionService.php104
7
App\Services\Region\SelectRegionService getUserRegionByIP
/app/Services/Region/SelectRegionService.php86
6
App\Services\Region\SelectRegionService getRegionName
/html/local/templates/main/header.php22
5
include_once
/html/bitrix/modules/main/include/prolog_after.php106
4
require
/html/bitrix/modules/main/include/prolog.php11
3
require_once
/html/bitrix/header.php1
2
require
/html/press_releases/index.php8
1
include_once
/html/bitrix/modules/main/include/urlrewrite.php159
0
include_once
/html/bitrix/urlrewrite.php2
/var/www/app/Services/Region/SelectRegionService.php
 
        return $this->getUserRegionByIP();
    }
 
    /**
     * Определяет регион пользователя по IP в справочнике ListOfRegions
     * Если регион есть в справочнике - возвращает его название
     * Если региона в справочнике нет - возвращает "Москва"
     *
     * @return string
     *
     * @throws ArgumentException
     * @throws ObjectNotFoundException
     * @throws ObjectPropertyException
     * @throws SystemException|LoaderException
     */
    public function getUserRegionByIP(): string
    {
        $ip = Manager::getRealIp();
        $geoData = Manager::getDataResult($ip, 'ru')->getGeoData();
 
        $regionName = !empty($geoData->regionName) ? $geoData->regionName : '';
 
        $regionIsCorrect = $this->checkRegionCorrectness($regionName);
 
        return $regionIsCorrect ? $regionName : self::DEFAULT_REGION;
    }
 
    /**
     * Возвращает XML_ID региона
     *
     * @param string $regionName
     *
     * @return string
     *
     * @throws ArgumentException
     * @throws ObjectNotFoundException
     * @throws ObjectPropertyException
     * @throws SystemException|LoaderException
     */
Arguments
  1. "Call to a member function getGeoData() on null"
    
/var/www/app/Services/Region/SelectRegionService.php
        return $_COOKIE[self::COOKIE_NAME];
    }
 
    /**
     * Получить название текущего региона пользователя
     *
     * @return string
     *
     * @throws ArgumentException
     * @throws ObjectNotFoundException
     * @throws ObjectPropertyException
     * @throws SystemException
     */
    public function getRegionName(): string
    {
        if ($this->hasCookie()) {
            return $this->getRegionFromCookie();
        }
 
        return $this->getUserRegionByIP();
    }
 
    /**
     * Определяет регион пользователя по IP в справочнике ListOfRegions
     * Если регион есть в справочнике - возвращает его название
     * Если региона в справочнике нет - возвращает "Москва"
     *
     * @return string
     *
     * @throws ArgumentException
     * @throws ObjectNotFoundException
     * @throws ObjectPropertyException
     * @throws SystemException|LoaderException
     */
    public function getUserRegionByIP(): string
    {
        $ip = Manager::getRealIp();
        $geoData = Manager::getDataResult($ip, 'ru')->getGeoData();
 
        $regionName = !empty($geoData->regionName) ? $geoData->regionName : '';
/var/www/html/local/templates/main/header.php
use App\Dictionaries\Redirects;
use App\Services\Region\SelectRegionService;
 
if (!defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true) {
    die();
}
/** @global CMain $APPLICATION */
 
$redirects = Redirects::getValues();
$page = $APPLICATION->GetCurPage();
 
if ($redirects[$page]) {
    LocalRedirect($redirects[$page]);
}
 
$asset = Bitrix\Main\Page\Asset::getInstance();
 
$regionService = container()->make(SelectRegionService::class);
$regionCookieIsset = $regionService->hasCookie();
$regionName = $regionService->getRegionName();
 
?>
<!DOCTYPE html>
<head>
    <title><?php $APPLICATION->ShowTitle(); ?></title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no">
    <link rel="preload" href="<?= constant('SITE_TEMPLATE_PATH') ?>/assets/fonts/stratos-regular-desktop.otf" as="font"
          crossorigin="anonymous" type="font/otf">
    <link rel="canonical"
          href="<?= $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . $APPLICATION->GetCurPage() ?>">
    <meta property="og:url"
          content="<?= $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . $APPLICATION->GetCurUri() ?>">
    <meta property="og:title" content="<?= $APPLICATION->ShowTitle() ?>">
    <meta property="og:description" content="<?= $APPLICATION->ShowProperty('description') ?>">
    <meta property="og:image"
          content="<?= $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . constant('SITE_TEMPLATE_PATH') ?>/assets/img/logo-icon.svg">
    <meta property="og:type" content="website">
    <?php
/var/www/html/bitrix/modules/main/include/prolog_after.php
    elseif(($siteClosed = getLocalPath("php_interface/include/site_closed.php", BX_PERSONAL_ROOT)) !== false)
    {
        include($_SERVER["DOCUMENT_ROOT"].$siteClosed);
    }
    else
    {
        include($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/site_closed.php");
    }
    die();
}
 
$sPreviewFile = $_SERVER["DOCUMENT_ROOT"].BX_PERSONAL_ROOT."/tmp/templates/__bx_preview/header.php";
if(defined("SITE_TEMPLATE_PREVIEW_MODE") && file_exists($sPreviewFile))
{
    include_once($sPreviewFile);
}
else
{
    \Bitrix\Main\Page\Asset::getInstance()->startTarget('TEMPLATE');
    include_once($_SERVER["DOCUMENT_ROOT"].SITE_TEMPLATE_PATH."/header.php");
    \Bitrix\Main\Page\Asset::getInstance()->startTarget('PAGE');
}
 
/* Draw edit menu for whole content */
global $BX_GLOBAL_AREA_EDIT_ICON;
$BX_GLOBAL_AREA_EDIT_ICON = false;
 
if($APPLICATION->GetShowIncludeAreas())
{
    $aUserOpt = CUserOptions::GetOption("global", "settings", array());
    if ($aUserOpt["page_edit_control_enable"] != "N")
    {
        $documentRoot = CSite::GetSiteDocRoot(SITE_ID);
        if(isset($_SERVER["REAL_FILE_PATH"]) && $_SERVER["REAL_FILE_PATH"] != "")
            $currentFilePath = $_SERVER["REAL_FILE_PATH"];
        else
            $currentFilePath = $APPLICATION->GetCurPage(true);
 
        $bCanEdit = true;
 
Arguments
  1. "/var/www/html/local/templates/main/header.php"
    
/var/www/html/bitrix/modules/main/include/prolog.php
<?
require_once(dirname(__FILE__)."/../bx_root.php");
 
if (file_exists($_SERVER["DOCUMENT_ROOT"].BX_PERSONAL_ROOT."/html_pages/.enabled"))
{
    require_once(dirname(__FILE__)."/../lib/composite/responder.php");
    Bitrix\Main\Composite\Responder::respond();
}
 
require_once(dirname(__FILE__)."/prolog_before.php");
require($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/include/prolog_after.php");
 
Arguments
  1. "/var/www/html/bitrix/modules/main/include/prolog_after.php"
    
/var/www/html/bitrix/header.php
<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog.php");?>
Arguments
  1. "/var/www/html/bitrix/modules/main/include/prolog.php"
    
/var/www/html/press_releases/index.php
<?php
define('MAIN_NAV_CLASS', 'news');
define('MAIN_NAV_WHITE', true);
 
/**
 * @var $APPLICATION ;
 */
require($_SERVER['DOCUMENT_ROOT'] . '/bitrix/header.php');
$APPLICATION->SetPageProperty('title', 'Пресс-релизы компании СОГАЗ-Мед');
$APPLICATION->SetPageProperty('description', 'Пресс-релизы компании СОГАЗ-Мед. Ознакомьтесь важными и интересными пресс-релизами на нашем официальном сайте.');
$APPLICATION->SetTitle('Пресс-релизы компании СОГАЗ-Мед');
?>
 
    <main class="page-main">
        <div class="page-main__wrapper">
            <?php $APPLICATION->IncludeComponent(
                'bitrix:menu',
                'right',
                [
                    'ALLOW_MULTI_SELECT' => 'N',
                    'CHILD_MENU_TYPE' => 'left',
                    'DELAY' => 'N',
                    'MAX_LEVEL' => '1',
                    'MENU_CACHE_GET_VARS' => [
                    ],
                    'EMPTY_ELEMENT' => 'Новости',
                    'INCLUDE_TEMPLATE' => 'news-contacts',
                    'MENU_CACHE_TIME' => 3600,
                    'MENU_CACHE_TYPE' => 'N',
                    'MENU_CACHE_USE_GROUPS' => 'N',
                    'ROOT_MENU_TYPE' => 'right',
                    'USE_EXT' => 'N',
                    'COMPONENT_TEMPLATE' => 'right'
                ],
                false
            );
 
            $APPLICATION->IncludeComponent('bitrix:news', 'press-release', [
                    'DISPLAY_DATE' => 'Y',
                    'DISPLAY_PICTURE' => 'Y',
Arguments
  1. "/var/www/html/bitrix/header.php"
    
/var/www/html/bitrix/modules/main/include/urlrewrite.php
                continue;
 
            if (!$io->ValidatePathString($url))
                continue;
 
            $urlTmp = mb_strtolower(ltrim($url, "/\\"));
            $urlTmp = str_replace(".", "", $urlTmp);
            $urlTmp7 = mb_substr($urlTmp, 0, 7);
 
            if (($urlTmp7 == "upload/" || ($urlTmp7 == "bitrix/" && mb_substr($urlTmp, 0, 16) != "bitrix/services/" && mb_substr($urlTmp, 0, 18) != "bitrix/groupdavphp")))
                continue;
 
            $ext = mb_strtolower(GetFileExtension($url));
            if ($ext != "php")
                continue;
 
            CHTTP::SetStatus("200 OK");
 
            $_SERVER["REAL_FILE_PATH"] = $url;
            include_once($io->GetPhysicalName($_SERVER['DOCUMENT_ROOT'].$url));
            die();
        }
    }
}
 
//admin section 404
if(mb_strpos($requestUri, "/bitrix/admin/") === 0)
{
    $_SERVER["REAL_FILE_PATH"] = "/bitrix/admin/404.php";
    include($_SERVER["DOCUMENT_ROOT"]."/bitrix/admin/404.php");
    die();
}
 
define("BX_CHECK_SHORT_URI", true);
 
Arguments
  1. "/var/www/html/press_releases/index.php"
    
/var/www/html/bitrix/urlrewrite.php
<?
include_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/urlrewrite.php');
if(file_exists($_SERVER['DOCUMENT_ROOT'].'/404.php'))
    include_once($_SERVER['DOCUMENT_ROOT'].'/404.php');
?>
Arguments
  1. "/var/www/html/bitrix/modules/main/include/urlrewrite.php"
    

Environment & details:

empty
empty
empty
empty
Key Value
SESS_AUTH
array:1 [
  "POLICY" => array:17 [
    "SESSION_TIMEOUT" => 180
    "SESSION_IP_MASK" => "0.0.0.0"
    "MAX_STORE_NUM" => 10
    "STORE_IP_MASK" => "0.0.0.0"
    "STORE_TIMEOUT" => 525600
    "CHECKWORD_TIMEOUT" => 525600
    "PASSWORD_LENGTH" => 6
    "PASSWORD_UPPERCASE" => "N"
    "PASSWORD_LOWERCASE" => "N"
    "PASSWORD_DIGITS" => "N"
    "PASSWORD_PUNCTUATION" => "N"
    "PASSWORD_CHANGE_DAYS" => 0
    "PASSWORD_UNIQUE_COUNT" => 0
    "LOGIN_ATTEMPTS" => 0
    "BLOCK_LOGIN_ATTEMPTS" => 0
    "BLOCK_TIME" => 0
    "PASSWORD_REQUIREMENTS" => "Пароль должен быть не менее 6 символов длиной."
  ]
]
SESS_IP
"10.99.102.112"
SESS_TIME
1634477926
IS_EXPIRED
null
BX_SESSION_SIGN
"898830601a1110f60d177d3fec1fe0f0"
SESS_OPERATIONS
[]
fixed_session_id
"215823464879c2836e7fc308bac9f192"
referer1
null
referer2
null
referer3
null
SESS_SEARCHER_ID
185
SESS_SEARCHER_NAME
"bot"
SESS_SEARCHER_CHECK_ACTIVITY
"Y"
SESS_SEARCHER_SAVE_STATISTIC
"N"
SESS_SEARCHER_HIT_KEEP_DAYS
null
SESS_LAST_PROTOCOL
null
SESS_LAST_URI
null
SESS_LAST_HOST
null
SESS_LAST_PAGE
null
SESS_LAST_DIR
null
SESS_HTTP_REFERER
null
SESS_COUNTRY_ID
null
SESS_CITY_ID
null
SESS_SESSION_ID
null
SESS_REFERER_ID
null
FROM_SEARCHER_ID
null
SESS_FROM_SEARCHERS
null
SESS_REQUEST_URI_CHANGE
null
SESS_LAST_DIR_ID
null
SESS_LAST_PAGE_ID
null
SESS_GRABBER_STOP_TIME
null
SESS_GRABBER_DEFENCE_STACK
null
ACTIVITY_EXCEEDING_NOTIFIED
null
Key Value
PHP_EXTRA_CONFIGURE_ARGS
"--enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi"
HOSTNAME
"f71ca096253e"
PHP_INI_DIR
"/usr/local/etc/php"
HOME
"/var/www"
XDEBUG_CONFIG
"remote_host=192.168.220.1 remote_enable=1"
PHP_IDE_CONFIG
"serverName=Docker"
PHP_LDFLAGS
"-Wl,-O1 -pie"
PHP_CFLAGS
"-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
PHP_VERSION
"7.4.22"
GPG_KEYS
"42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312"
PHP_CPPFLAGS
"-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
PHP_ASC_URL
"https://www.php.net/distributions/php-7.4.22.tar.xz.asc"
PHP_URL
"https://www.php.net/distributions/php-7.4.22.tar.xz"
PATH
"/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
PHPIZE_DEPS
"autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c"
PWD
"/var/www"
PHP_SHA256
"8e078cd7d2f49ac3fcff902490a5bb1addc885e7e3b0d8dd068f42c68297bde8"
USER
"www-data"
HTTP_ACCEPT_ENCODING
"br,gzip"
HTTP_ACCEPT_LANGUAGE
"en-US,en;q=0.5"
HTTP_ACCEPT
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_USER_AGENT
"CCBot/2.0 (https://commoncrawl.org/faq/)"
HTTP_CONNECTION
"close"
HTTP_HOST
"sogaz-med.ru"
REDIRECT_STATUS
"200"
SERVER_NAME
"sogaz.loc"
SERVER_PORT
"80"
SERVER_ADDR
"192.168.220.4"
REMOTE_PORT
"39470"
REMOTE_ADDR
"10.99.102.112"
SERVER_SOFTWARE
"nginx/1.18.0"
GATEWAY_INTERFACE
"CGI/1.1"
REQUEST_SCHEME
"http"
SERVER_PROTOCOL
"HTTP/1.0"
DOCUMENT_ROOT
"/var/www/html"
DOCUMENT_URI
"/bitrix/urlrewrite.php"
REQUEST_URI
"/press_releases/sogaz-med-proinformiroval-zhiteley-bezymyanskogo-municipalnogo-obrazovaniya-o-sisteme-oms/"
SCRIPT_NAME
"/bitrix/urlrewrite.php"
CONTENT_LENGTH
""
CONTENT_TYPE
""
REQUEST_METHOD
"GET"
QUERY_STRING
""
PATH_INFO
""
SCRIPT_FILENAME
"/var/www/html/bitrix/urlrewrite.php"
FCGI_ROLE
"RESPONDER"
PHP_SELF
""
REQUEST_TIME_FLOAT
1634477926.0548
REQUEST_TIME
1634477926
argv
[]
argc
0
WEBSERVER_PORT
"80"
DB_PORT
"3306"
MYSQL_HOST
"sogmed-mysql"
MYSQL_USER
"sogaz_med"
MYSQL_PASSWORD
"m:M*Foe*0Z}O"
MYSQL_ROOT_PASSWORD
"sogaz_med"
MYSQL_DATABASE
"sogaz_med"
DEBUG
"false"
DBDEBUG
"false"
DEV_MODE
"false"
GOOGLE_RECAPTCHA_API_KEY
"6LcgQoocAAAAADopyybHj6NJBxgqiG2hXwjWDPC_"
GOOGLE_RECAPTCHA_SECRET_KEY
"6LcgQoocAAAAANYE4kaYDkbs_aYqOaV-zjuBzBtT"
YANDEX_MAP_API_KEY
"d76254e1-30a1-4df1-a16e-17ff73e85572"
BASE_API_URL
"https://api-customersservice.sogaz-med.ru:8443"
MOBILE_API_URL
"https://patient.oms-dev.ru"
LK_URL
"https://lk.sogaz-med.ru/"
REAL_FILE_PATH
"/press_releases/index.php"
Key Value
PHP_EXTRA_CONFIGURE_ARGS
"--enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi"
HOSTNAME
"f71ca096253e"
PHP_INI_DIR
"/usr/local/etc/php"
HOME
"/var/www"
XDEBUG_CONFIG
"remote_host=192.168.220.1 remote_enable=1"
PHP_IDE_CONFIG
"serverName=Docker"
PHP_LDFLAGS
"-Wl,-O1 -pie"
PHP_CFLAGS
"-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
PHP_VERSION
"7.4.22"
GPG_KEYS
"42670A7FE4D0441C8E4632349E4FDC074A4EF02D 5A52880781F755608BF815FC910DEB46F53EA312"
PHP_CPPFLAGS
"-fstack-protector-strong -fpic -fpie -O2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
PHP_ASC_URL
"https://www.php.net/distributions/php-7.4.22.tar.xz.asc"
PHP_URL
"https://www.php.net/distributions/php-7.4.22.tar.xz"
PATH
"/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
PHPIZE_DEPS
"autoconf \t\tdpkg-dev \t\tfile \t\tg++ \t\tgcc \t\tlibc-dev \t\tmake \t\tpkg-config \t\tre2c"
PWD
"/var/www"
PHP_SHA256
"8e078cd7d2f49ac3fcff902490a5bb1addc885e7e3b0d8dd068f42c68297bde8"
USER
"www-data"
HTTP_ACCEPT_ENCODING
"br,gzip"
HTTP_ACCEPT_LANGUAGE
"en-US,en;q=0.5"
HTTP_ACCEPT
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_USER_AGENT
"CCBot/2.0 (https://commoncrawl.org/faq/)"
HTTP_CONNECTION
"close"
HTTP_HOST
"sogaz-med.ru"
REDIRECT_STATUS
"200"
SERVER_NAME
"sogaz.loc"
SERVER_PORT
"80"
SERVER_ADDR
"192.168.220.4"
REMOTE_PORT
"39470"
REMOTE_ADDR
"10.99.102.112"
SERVER_SOFTWARE
"nginx/1.18.0"
GATEWAY_INTERFACE
"CGI/1.1"
REQUEST_SCHEME
"http"
SERVER_PROTOCOL
"HTTP/1.0"
DOCUMENT_ROOT
"/var/www/html"
DOCUMENT_URI
"/bitrix/urlrewrite.php"
REQUEST_URI
"/press_releases/sogaz-med-proinformiroval-zhiteley-bezymyanskogo-municipalnogo-obrazovaniya-o-sisteme-oms/"
SCRIPT_NAME
"/bitrix/urlrewrite.php"
CONTENT_LENGTH
""
CONTENT_TYPE
""
REQUEST_METHOD
"GET"
QUERY_STRING
""
PATH_INFO
""
SCRIPT_FILENAME
"/var/www/html/bitrix/urlrewrite.php"
FCGI_ROLE
"RESPONDER"
WEBSERVER_PORT
"80"
DB_PORT
"3306"
MYSQL_HOST
"sogmed-mysql"
MYSQL_USER
"sogaz_med"
MYSQL_PASSWORD
"m:M*Foe*0Z}O"
MYSQL_ROOT_PASSWORD
"sogaz_med"
MYSQL_DATABASE
"sogaz_med"
DEBUG
"false"
DBDEBUG
"false"
DEV_MODE
"false"
GOOGLE_RECAPTCHA_API_KEY
"6LcgQoocAAAAADopyybHj6NJBxgqiG2hXwjWDPC_"
GOOGLE_RECAPTCHA_SECRET_KEY
"6LcgQoocAAAAANYE4kaYDkbs_aYqOaV-zjuBzBtT"
YANDEX_MAP_API_KEY
"d76254e1-30a1-4df1-a16e-17ff73e85572"
BASE_API_URL
"https://api-customersservice.sogaz-med.ru:8443"
MOBILE_API_URL
"https://patient.oms-dev.ru"
LK_URL
"https://lk.sogaz-med.ru/"
0. Whoops\Handler\PrettyPageHandler