After a update I can not login anymore to the admin backend. I had this issue several times after an update but until now could resolve it with the common tips (wipe static data, cleaup all caches, rebuild static content etc.). But this time I am stuck.

I tried to debug the problem but did not get too far up to now. Does nobody else have this issue?

I have URL Server rewrites enabled. index.php is called with my admin path. And then the redirect to some magic localhost path happens. Due to the fancy software architecture of Magento 2 it is very difficult to figure out what is going on just from looking at the code, even with using ack grep.

The database entries for web/unsecure/base_link_url and web/secure/base_link_url are correct with trailing slash. The shop frontend page works without any problems, with and without ssl.

Could you point me to some manuals or give tips how I can enable more extensive logging in magento.

E.g. enable some debug log to pin down what happens. Please no magic tricks ala erase that and that. I really whant to understand what is going wrong here once and for all. Next step is to disable server side URL rewrites but I doubt that fixes anything because index.php is called with the right arguments.

Thanks for your help.


OK so I figured it out using the good old var_dump and print poor mans debugger. You would say it is obvious, but whatever. I figured out that from within Magento everything goes fine except that he really generates the localhost path as base. And well you cannot enable logging because there is no logging, at least in all the classes I looked at :-).

The problem was that in the core_config_data SQL table an entry also may have a scope, default or website for example. When I checked for e.g. web/unsecure/base_url I got some value but did not realize it only was set for website. The two default scope paths for secure and unsecure websites were set to {{base_url}} and {{unsecure_base_url}} and this seems to fallback to localhost. I now also set the default scope paths to the correct url and it works. Why this ever worked before, I don't know.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.