1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't upgrade: Protocol s3:// is already defined

Discussion in 'Troubleshooting and Problems' started by Minecraftly, Dec 28, 2015.

  1. Minecraftly

    Minecraftly Member

    I couldn't upgrade from 1.5.2 to 1.5.3 (or 1.5.4)

    Screenshot: https://gyazo.com/f8a80044c38347d0a8e5d87ee7b17b49

    Code:
    Failed to get controller response and reroute to error handler (XenForo_Install_Controller_Upgrade::actionrun)
    An exception occurred: stream_register_wrapper(): Protocol s3:// is already defined. in /minecraftly/library/Zend/Service/Amazon/S3.php on line 940
    
    XenForo_Application::handlePhpError()
    stream_register_wrapper() in Zend/Service/Amazon/S3.php at line 940
    Zend_Service_Amazon_S3->registerStreamWrapper() in config.php at line 17
    require() in XenForo/Application.php at line 616
    XenForo_Application->loadConfig() in XenForo/Application.php at line 265
    XenForo_Application->loadDefaultData() in XenForo/Install/Controller/Abstract.php at line 10
    XenForo_Install_Controller_Abstract->_preDispatchFirst() in XenForo/Controller.php at line 304
    XenForo_Controller->preDispatch() in XenForo/FrontController.php at line 350
    XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    XenForo_FrontController->run() in /minecraftly/install/index.php at line 18
     
  2. Minecraftly

    Minecraftly Member

    When I reverted back to 1.5.2, it gives me blank page in admin.php
     
  3. Mike

    Mike XenForo Developer Staff Member

    This relates to customizations you have made, likely in your config.php file. You may need to remove them or change how they're defined. I guess an add-on told you to make the changes, so it'd be best to contact the author.
     
  4. Minecraftly

    Minecraftly Member

    Here's my config, it only deals with Xenforo add-ons, not any third party ones:

    Code:
    <?php
    
    $config['db']['host'] = 'masked';
    $config['db']['port'] = '3306';
    $config['db']['username'] = 'masked';
    $config['db']['password'] = 'masked';
    $config['db']['dbname'] = 'masked';
    
    $config['superAdmins'] = '1';
    
    $_SERVER['HTTPS'] = 'on';
    
    $config['enableGzip'] = true;
    
    require_once 'Zend/Service/Amazon/S3.php';
    $s3 = new Zend_Service_Amazon_S3('masked', 'masked');//credentials of iam user with s3 permissions
    $s3->registerStreamWrapper("s3");
    
    $config['externalDataPath'] = 's3://d.m.ly';
    $config['externalDataUrl'] = 'https://d.m.ly'; //this address can be the s3 address or another address that utilises a CDN
    
    $config['passwordIterations'] = 12;
    
    #$config['cookie'] = array(
    #    'prefix' => 'xf_',
    #    'path' => '/',
    #    'domain' => 'c.m.ly'
    #);
    
    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
    $config['cache']['cacheSessions'] = false; //Disable if randomly kicked from admin panel
    $config['cache']['backend'] = 'Memcached';
    $config['cache']['backendOptions'] = array(
        'compression' => true,
        'servers' => array(
            array(
                // your memcached server IP /address
                'host' => 'masked',
             
                // memcached port
                'port' => 1111,
            )
        )
    );
    
    if (isset($_SERVER['HTTP_CF_CONNECTING_IP'])) { $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_CF_CONNECTING_IP']; }
    Can you help let me know what should be fixed?
     
  5. Mike

    Mike XenForo Developer Staff Member

    The error is due to the S3 elements you have added there.
     
  6. Minecraftly

    Minecraftly Member

    It's for enabling Zend S3, part of what Xenforo required for S3 to work. How do I fix it?
     
  7. Mike

    Mike XenForo Developer Staff Member

    Just to clarify, that isn't really something we officially support. But you might need to temporarily remove it during the upgrade or add additional code to ensure that it isn't triggered multiple times (as config.php can be included multiple times in the upgrade system).
     
  8. Minecraftly

    Minecraftly Member

    I've fixed it by disabling Memcached in the config, interesting.

    What do you mean by not officially support this? I use Media add-on by Xenforo, and enabled S3 feature for that add-on to work (used Zend built into Xenforo), so I'm confused as to why you don't officially support it?
     
  9. Mike

    Mike XenForo Developer Staff Member

    You've added additional custom code and are using something that isn't documented to work (such as a cache) or configurable via the UI. I'm not saying it won't work, but if you have problems with files like that, you'd need to disable it for debugging.
     
  10. Minecraftly

    Minecraftly Member

    I'm not saying that you don't have the right to not support it, but I'm still confused. The reason is because Memcached config is documented in here https://xenforo.com/help/cache/, and I did exactly that. I try to not configure outside of what Xenforo officially documented to reduce headaches in the future, sometimes errors can still happen.

    When it comes to problems like these, I'm a noob, and I need help, where else can I go. So when I see that you don't officially support it, I'm officially worried.
     
  11. Mike

    Mike XenForo Developer Staff Member

    The error in question was generally unrelated to Memcache; I'm not sure why removing that would have changed anything unless there was a separate issue happening there. It's your S3 configuration:
    Code:
    require_once 'Zend/Service/Amazon/S3.php';
    $s3 = new Zend_Service_Amazon_S3('masked', 'masked');//credentials of iam user with s3 permissions
    $s3->registerStreamWrapper("s3");
    
     

Share This Page