View Issue Details

IDProjectCategoryView StatusLast Update
0006401OXID eShop (all versions)4.08. Cachepublic2016-06-06 16:54
ReporterGM_Alex 
PrioritynormalSeverityminorReproducibilityunable to reproduce
Status acknowledgedResolutionreopened 
PlatformUnixOSOS Version
Product Version4.8.3 / 5.1.3 
Target VersionFixed in Version 
Summary0006401: Invalide Reverse Proxy setup breaks backend
DescriptionIf the Reverse Proxy is not proper stetted up, for example on a staging system without varnish enabled, enabling the Reverse Proxy will break the backend. You are getting errors like the following:

oxException (time: 2016-06-06 16:38:51): [0]: EXCEPTION_CURL_ERROR
 Stack Trace: #0 /var/www/html/core/oxutilsobject.php(180): oxUtilsObject->_getObject('oxexception', 0, Array)
#1 [internal function]: oxUtilsObject->oxNew('oxException')
#2 /var/www/html/core/oxfunctions.php(363): call_user_func_array(Array, Array)
#3 /var/www/html/core/oxcurl.php(302): oxNew('oxException')
#4 /var/www/html/core/cache/connectors/oxreverseproxyconnector.php(92): oxCurl->execute()
#5 /var/www/html/core/cache/connectors/oxreverseproxyconnector.php(105): oxReverseProxyConnector->_callCurl('PURGE', 'http://schulung...', Array)
#6 /var/www/html/core/cache/connectors/oxreverseproxyconnector.php(169): oxReverseProxyConnector->purge('http://schulung...', Array)
#7 /var/www/html/core/cache/oxreverseproxybackend.php(165): oxReverseProxyConnector->invalidate('/widget.php?.*a...')
#8 /var/www/html/core/oxshopcontrol.php(436): oxReverseProxyBackend->execute()
#9 /var/www/html/core/oxshopcontrol.php(131): oxShopControl->_process('article_main', 'save', NULL, NULL)
#10 /var/www/html/core/oxid.php(32): oxShopControl->start()
0000011 /var/www/html/index.php(18): Oxid::run()
0000012 /var/www/html/admin/index.php(19): require_once('/var/www/html/i...')
0000013 {main}


Changing _callCurl at oxReverseProxyConnector from


    /**
     * Build and call CURL request.
     *
     * @param string $sRequestMethod Request method (PURGE, REFRESH, BAN).
     * @param string $sUrl URL to be called.
     * @param array $aHeaders Additional headers.
     *
     * @return null
     */
    protected function _callCurl( $sRequestMethod, $sUrl, $aHeaders = array() )
    {
        $oCurl = oxNew( 'oxCurl' );
        $oCurl->setMethod( "GET" );
        $oCurl->setUrl( $sUrl );
        $oCurl->setHeader( $aHeaders );
        $oCurl->setOption( 'CURLOPT_FRESH_CONNECT', true );
        $oCurl->setOption( 'CURLOPT_CUSTOMREQUEST', $sRequestMethod );
        $oCurl->setOption( 'CURLOPT_HEADER', false );
        $oCurl->setOption( 'CURLOPT_NOBODY', true );
        $oCurl->execute();
    }

to


    /**
     * Build and call CURL request.
     *
     * @param string $sRequestMethod Request method (PURGE, REFRESH, BAN).
     * @param string $sUrl URL to be called.
     * @param array $aHeaders Additional headers.
     *
     * @return null
     */
    protected function _callCurl( $sRequestMethod, $sUrl, $aHeaders = array() )
    {
        $oCurl = oxNew( 'oxCurl' );
        $oCurl->setMethod( "GET" );
        $oCurl->setUrl( $sUrl );
        $oCurl->setHeader( $aHeaders );
        $oCurl->setOption( 'CURLOPT_FRESH_CONNECT', true );
        $oCurl->setOption( 'CURLOPT_CUSTOMREQUEST', $sRequestMethod );
        $oCurl->setOption( 'CURLOPT_HEADER', false );
        $oCurl->setOption( 'CURLOPT_NOBODY', true );

        try {
            $oCurl->execute();
        } catch(\Exception $e) {

        }
    }

will solve the issue.
Steps To Reproduce- set up an apache server
- set up a varnish server
- install shop and configure varnish
- change /etc/hosts in apache server that it can't resolve the domain of the varnish server
- go to admin and make that shop invalidates varnish cache, e.g. change price of an article
TagsNo tags attached.
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
MySQL VersionNot defined

Activities

QA

2016-05-27 15:26

administrator   ~0011609

Reminder sent to: GM_Alex

Thank you for submitting the issue. Unfortunately we can't reproduce it. I just activated the reverse proxy an a server without varnish. There are no problems in the admin. Please add the steps to reproduce.

GM_Alex

2016-05-27 15:46

reporter   ~0011611

Step to reproduce:

1. Activate the Reverse Proxy
2. Update the product data of a product and save it.

QA

2016-05-27 17:50

administrator   ~0011612

We can't reproduce this issue with your steps to reproduce. So this is closed as unable to reproduce.

GM_Alex

2016-05-30 14:35

reporter   ~0011614

The error occurs if the getUrl function of oxCurl returns a not resolvable URL, like a local development address or a page which is protected by htaccess.

QA

2016-05-30 15:33

administrator   ~0011616

Reminder sent to: GM_Alex

Thank you for your information. Unfortunately we still can't reproduce it. Please add detailed steps to reproduce.

QA

2016-06-06 16:52

administrator   ~0011626

I changed the stack trace int the description because the original stack trace is probably from another problem. I also added steps to reproduce.