Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

Installed patch, but unable to log into magento admin backend #23

Closed
mrlerch opened this issue Mar 3, 2016 · 11 comments
Closed

Installed patch, but unable to log into magento admin backend #23

mrlerch opened this issue Mar 3, 2016 · 11 comments

Comments

@mrlerch
Copy link

mrlerch commented Mar 3, 2016

Hello,

So I installed the patch. I can access the magento site front end now, and the backend, but I can't log in to the backend (most likely not in the front end either). Here is the error message I am getting when I try to log in to admin:

Invalid Form Key. Please refresh the page.

Here is the error message in the magento system.log:

2016-03-03T04:22:59+00:00 ERR (3): Warning: session_module_name(): Cannot find named PHP session module (memcache) in /var/www/www.proproductssales.com/html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 81
2016-03-03T04:22:59+00:00 ERR (3): Warning: session_start(): open(tcp://127.0.0.1:11211?persistent=1&weight=2&timeout=10&retry_interval=10/sess_2rvk3rvc73tp9pkdvkpecut234, O_RDWR) failed: No such file or directory (2) in /var/www/www.proproductssales.com/html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 133

Please be advised that there currently does not seem to be a php 7 memcache installation via yum available. Does that mean that for now I have to revert back to PHP 5? Or is there another work around I can try. From what I saw the front end of Magento seems to be rocking fast with PHP 7

Please advise.

Thanks,

Martin

@durzel
Copy link
Contributor

durzel commented Mar 3, 2016

php-pecl-memcache.x86_64 : Extension to work with the Memcached caching daemon
php-pecl-memcached.x86_64 : Extension to work with the Memcached caching daemon

These are available in the base repos on CentOS 7 - is that not what you want?

@mrlerch
Copy link
Author

mrlerch commented Mar 3, 2016

Thank you so much for your reply, Darren.

I had the server already set up using php 5 from the remi repo. So I followed the instructions on upgrading to php70 as outlined on webtatic. But under webtatic I was unable to find php-pecl-memcache at all, and I was unable to install it using pecl install memcache either.

So are you saying I should use base repo? I am running centOS 6.7. Any help would be appreciated.

Sincerely,

Martin

On Mar 3, 2016, at 2:24 AM, Darren Coleman notifications@github.com wrote:

php-pecl-memcache.x86_64 : Extension to work with the Memcached caching daemon
php-pecl-memcached.x86_64 : Extension to work with the Memcached caching daemon

These are available in the base repos on CentOS 7 - is that not what you want?


Reply to this email directly or view it on GitHub #23 (comment).

@mrlerch
Copy link
Author

mrlerch commented Mar 4, 2016

Hello again. This time I upgraded to PHP 7 using the remi repo and it included memcache. So we are a step further here. However I am still unable to log in to Magento 1.9.2.4 admin (I did apply the patch Inchoo_PHP7 prior). What happens is strange. I go to the Magento admin login page and log in and I don't get a wrong password notice or nothing. Page just reloads to: .../index/index/key/30ffffede2aacc819a7739929a0ab3af/ (same login page).

It should however log me in and go to .../dashboard/index/key/30ffffede2aacc819a7739929a0ab3af/ or something like that.

I checked in system.log and found this:

2016-03-04T18:29:37+00:00 ERR (3): Recoverable Error: session_regenerate_id(): Failed to create(read) session ID: memcache (path: tcp://127.0.0.1:11211?persistent=1&weight=2&timeout=10&retry_interval=10) in /var/www/www.proproductssales.com/html/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php on line 492

Anyone knows what is happening here? I really would like to test magento 1.9.2.4 on PHP 7. Seems really fast in the front end.

Sincerely,

Martin

@icurdinj
Copy link
Contributor

icurdinj commented Mar 7, 2016

Seems like the same session error we already fixed for db and redis backends. But we never got to testing with memcache. If someone has got time to implement the same fix for memcache and make a pull request, it's welcome!

@mrlerch
Copy link
Author

mrlerch commented Mar 7, 2016

So what can I do? Uninstall memcache, and use db and redis (I am sorry, but I don't know too much about db / redis for PHP). Please advise.

Thanks.

@ivanweiler
Copy link
Contributor

Hello all,

It seems native php memcache extension currently has problem with session_regenerate_id(). Same situation was with php-redis few moths ago, php7 changed something related session_regenerate_id that broke similar php extensions.

For example, it won't work if you simply try:

session_save_path('tcp://localhost:11211?persistent=1&weight=2&timeout=10&retry_interval=10');
session_module_name('memcache');

session_start();
session_regenerate_id(); // throws Catchable fatal error !!

So, Magento is just using built in session handler for memcache, which isn't working at the moment. It seems php-memcache needs to be fixed, not Magento, and it will be eventually.

I also tested memcacheD, which is newer extension and it seems memcached is working, so maybe it can be used instead in Magento.

@mrlerch: I'm using Ubuntu, so different repos, I'm not sure what's the situation on CentOs, but try installing php memcached extension (it's php-memcached on Ubuntu) and change local.xml to something like this:

<session_save><![CDATA[memcached]]></session_save>
<session_save_path><![CDATA[localhost:11211]]></session_save_path>

memcached instead of memcache, tcp:// removed for memcached. I never used memcached in production, but it works for me on my dev machine, login works.

Hope it helps,
Ivan

@mrlerch
Copy link
Author

mrlerch commented Mar 8, 2016

Hello and thank you Ivan for the clear instructions. I was able to find and install memcached for php 7.0.4. I also made the changes in local.xml per your instructions, however here is a new issue now.

Magento front end store page - blank
Magneto back end - blank

entry in system.log:
ERR (3): Notice: Array to string conversion in .../app/code/core/Mage/Core/Model/Layout.php on line 555

Here is another thing. I am really trying to get this setup for production. What is your hesitation with memcached instead of memcache? Is there another cache method that I could try? Here is what I have installed:

[root@host log]# yum list installed php*
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile

  • base: mirrors.kernel.org
  • epel: mirrors.tummy.com
  • extras: linux.mirrors.es.net
  • remi-safe: remi.kazukioishi.net
  • updates: centos.netnitco.net
    Installed Packages
    php.x86_64 7.0.4-1.el6.remi @remi-php70
    php-bcmath.x86_64 7.0.4-1.el6.remi @remi-php70
    php-cli.x86_64 7.0.4-1.el6.remi @remi-php70
    php-common.x86_64 7.0.4-1.el6.remi @remi-php70
    php-fpm.x86_64 7.0.4-1.el6.remi @remi-php70
    php-gd.x86_64 7.0.4-1.el6.remi @remi-php70
    php-json.x86_64 7.0.4-1.el6.remi @remi-php70
    php-mbstring.x86_64 7.0.4-1.el6.remi @remi-php70
    php-mcrypt.x86_64 7.0.4-1.el6.remi @remi-php70
    php-mysqlnd.x86_64 7.0.4-1.el6.remi @remi-php70
    php-opcache.x86_64 7.0.4-1.el6.remi @remi-php70
    php-pdo.x86_64 7.0.4-1.el6.remi @remi-php70
    php-pear.noarch 1:1.10.1-1.el6.remi @remi-php70
    php-pecl-geoip.x86_64 1.1.0-9.el6.remi.7.0 @remi-php70
    php-pecl-igbinary.x86_64 1.2.2-0.1.20151217git2b7c703.el6.remi.7.0 @remi-php70
    php-pecl-memcache.x86_64 3.0.9-0.2.20151130gitfdbd46b.el6.remi.7.0 @remi-php70
    php-pecl-memcached.x86_64 3.0.0-0.1.20160217git6ace07d.el6.remi.7.0 @remi-php70
    php-pecl-msgpack.x86_64 2.0.1-1.el6.remi.7.0 @remi-php70
    php-pecl-redis.x86_64 2.2.8-0.5.20160215git2887ad1.el6.remi.7.0 @remi-php70
    php-pecl-zip.x86_64 1.13.2-1.el6.remi.7.0 @remi-php70
    php-process.x86_64 7.0.4-1.el6.remi @remi-php70
    php-soap.x86_64 7.0.4-1.el6.remi @remi-php70
    php-xml.x86_64 7.0.4-1.el6.remi @remi-php70
    [root@host log]#

Oh yes, funny enough, phpMyAdmin runs perfectly fine (same nginx host as mangento - same web dir as a matter of fact).

Thanks for any help you have for me

Martin

On Mar 8, 2016, at 7:15 AM, Ivan Weiler notifications@github.com wrote:

Hello all,

It seems native php memcache extension currently has problem with session_regenerate_id(). Same situation was with php-redis few moths ago, php7 changed something related session_regenerate_id that broke similar php extensions.

For example, it won't work if you simply try:

session_save_path('tcp://localhost:11211?persistent=1&weight=2&timeout=10&retry_interval=10');
session_module_name('memcache');

session_start();
session_regenerate_id(); // throws Catchable fatal error !!
Magento is just using built in session handler for memcache, which isn't working at the moment, it will be fixed eventually.
I also tested memcached, which is newer extension and it seems memcached is working, so maybe it can be used instead in Magento.

@mrlerch https://github.com/mrlerch: I'm using Ubuntu, so different repos, I'm not sure what's the situation on CentOs, but try installing php memcached extension (it's php-memcached on Ubuntu) and change local.xml to something like this:

<session_save></session_save>
<session_save_path></session_save_path>
memcached instead of memcache, tcp:// removed for memcached. I never used memcached in production, but it works for me on my dev machine, login works.

Hope it helps,
Ivan


Reply to this email directly or view it on GitHub #23 (comment).

@mrlerch
Copy link
Author

mrlerch commented Mar 8, 2016

Sorry, I am complete retard! I installed php7 and memcached and made the changes to the local.xml file, but didn't install the inchoo php7 patch - lol. That made a difference. So I am able to see, use (kind of) the front end and log in to the back end.

Issues: AvaTax (from Avalara) (latest version 3.0.0) does not seem to work. Does not return tax calls, actually responds with an error message. under php 5.5 it workes just fine.

How to trouble shoot this issue? Thanks

@durzel
Copy link
Contributor

durzel commented Mar 8, 2016

What's the error message?

@mrlerch
Copy link
Author

mrlerch commented Mar 8, 2016

So I can't find an error message in system.log. But in the AvaTax log inside Magento under Sales -> Tax - > AvaTax log I see an error message. And when I click on it I get a report with Request, Response, Additional

The Requests seem to look identical to the requests under PHP 5.5.
The Response however looks like this:

GetTaxResult Object
(
[DocCode:GetTaxResult:private] =>
[DocId:GetTaxResult:private] => 0
[AdjustmentDescription:GetTaxResult:private] =>
[DocDate:GetTaxResult:private] => 2016-03-08
[TaxDate:GetTaxResult:private] => 2016-03-08
[DocType:GetTaxResult:private] => SalesOrder
[DocStatus:GetTaxResult:private] => Temporary
[Reconciled:GetTaxResult:private] =>
[Locked:GetTaxResult:private] =>
[Timestamp:GetTaxResult:private] => 2016-03-08T22:45:52.9536571Z
[TotalAmount:GetTaxResult:private] => 0
[TotalDiscount:GetTaxResult:private] => 0
[TotalExemption:GetTaxResult:private] => 0
[TotalTaxable:GetTaxResult:private] => 0
[TotalTax:GetTaxResult:private] => 0
[AdjustmentReason:GetTaxResult:private] => 0
[Version:GetTaxResult:private] => 1
[TaxLines:GetTaxResult:private] => stdClass Object
(
)

[TotalTaxCalculated:GetTaxResult:private] => 0
[TaxSummary:GetTaxResult:private] => stdClass Object
    (
    )

[TransactionId:GetTaxResult:private] => 4791411529536571
[ResultCode:GetTaxResult:private] => Error
[Messages:GetTaxResult:private] => stdClass Object
    (
        [Message] => Message Object
            (
                [Summary:Message:private] => Lines is expected to be between 1 and 15000.
                [Details:Message:private] => 
                [HelpLink:Message:private] => http://www.avalara.com
                [RefersTo:Message:private] => Lines
                [Severity:Message:private] => Error
                [Source:Message:private] => Avalara.AvaTax.Services
                [Name:Message:private] => RangeError
            )

    )

[HashCode] => 0
[TaxAddresses] => stdClass Object
    (
    )

[VolatileTaxRates] => 

)

Is there a better way to log what's going on and why there is an error? How do I enable logging in Magento's var/log folder for what is happening with this extension?

Thanks.

@icurdinj
Copy link
Contributor

We can't fix extension incompatibilites here. @mrlerch, please check with extension maker.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants