Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Composer Install of 2.2.6 have URL issues #316

Open
kreativmind opened this issue Feb 16, 2021 · 7 comments
Open

New Composer Install of 2.2.6 have URL issues #316

kreativmind opened this issue Feb 16, 2021 · 7 comments

Comments

@kreativmind
Copy link

kreativmind commented Feb 16, 2021

To install I ran via SSHL
composer create-project elefant/cms --stability=dev

Then, I moved the contents of the mysite.com/cms folder to root (1 folder up) mysite.com

I ran ./elefant permissions which then errored and said folder CSS didn't exist, so I ran mkdir css and ran the permissions command again and completed the installation steps as usual.

The links at the end of the installation give you the option to go to admin. That link didn't work. mysite.com/admin Page doesnt work err_invalid_redirect

Then, when I try logging in from the front page, I get routed to this url: https://user/

Any ideas?

*Just to update you...I installed 2.2.5 from the tar.gz download, extracted, uploaded, ran ./elefant permissions, had to make css dir and ran permissions command again and then installed. Admin Login link brought me to the correct page where it asked for my email address and password but then when you try to login, the err_invalid_redirect starts happening again.
This page isn’t working right now
mysite.com sent an invalid response.
ERR_INVALID_REDIRECT

When I type in mysite.com, I am logged in and can access admin tools. However, if I logout, I cannot get back in.

@jbroadway
Copy link
Owner

Hey , thanks for the head's up!

I updated the version to 2.2.6 in master thinking I would get to a release sooner then promptly got busy and didn't finish the job...

To fix the redirect and links not working, try saving the following to a file named conf/app.admin.config.php:

; <?php /*

[Site Settings]

site_domain             = www.mysite.com

; */ ?>

If you can still log in, you can also update that setting under Administration > Site Settings. I'm probably making assumptions in the update that that setting will always be set, so I'll see about fixing that up. Also just pushed a fix for the ./elefant permissions error.

Let me know if that gets things working.

@kreativmind
Copy link
Author

Hey Johnny, Little update. So I see that you removed css from the permissions file. I added the file as you asked and running composer and permissions went smooth. I performed the install without problems. I get to the admin link and it brings me to the correct page to login. I enter my email and password address but I get the following page and error message:

The site at mysite.com/admin has experienced a network protocol violation that cannot be repaired.

The page you are trying to view cannot be shown because an error in the data transmission was detected.

Please contact the website owners to inform them of this problem.

I click to go back to mysite.com and I get the homepage and see that I am logged in. I can click on the top bar and go to settings. I check the Site Settings and the Site domain is filled in from the file we created. I click Save Settings anyway and am met with a blank white page. I click back button, I get the same error about error in data transmission was detected.....etc. I enter mysite.com again in the address bar and am back at the home page again and can click on the admin bar again.

Is it possible that either a) its because my install of 2.6 is installed on a subdomain? or possibly b) there is some issue with the routing? Reason why I mention about the routing is because if you just do mysite.com/admin, the browser doesn't like it and gives errors. If you go to mysite.com/admin/settings, it brings you to settings. If you click on admin bar and click Languages, it puts translator/build in your address bar only and strips mysite.com away. The other links seem to be directing to the correct page.

Did you do any code changes to the routes for 2.6 differently than 2.5? You know I am not a programmer but just trying to use logic to figure it out or at least help troubleshoot.

@jbroadway
Copy link
Owner

Hey, my apologies. I spent a week away at a cabin and got swamped the minute I got back.

I'm not sure what's going on with the redirect at mysite.com/admin but the site settings screen going blank is probably because I had you add that file without updating its permissions to be writeable by the web server. The site settings form writes to that same file. I think re-running ./elefant permissions should fix that.

For the redirect, I wonder if you can run a test for me? Here are the steps:

1. Add the following code to apps/admin/handlers/index.php, right before the $this->redirect on the last line:

error_log ('[' . $_POST['redirect'] . ', ' . conf ('General', 'site_domain') . ', ' . Appconf::admin ('Site Settings', 'site_domain') . ', ' . $_SERVER['HTTP_HOST'] . ']');

2. Log in at mysite.com/admin
3. Find your web server's error log file and let me know what it outputs.
4. Remove the line from step 1 afterwards :)

That should output something like [/, mysite.com, mysite.com, mysite.com] but if one of them is empty that gives me a clue where to look.

@kreativmind
Copy link
Author

Here are the results:

[11-Mar-2021 04:55:01 UTC] PHP Deprecated: Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /home/me/public/mysite.com/install/index.php on line 103
[11-Mar-2021 04:55:01 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/me/public/mysite.com/install/index.php on line 45
[11-Mar-2021 04:55:15 UTC] PHP Deprecated: Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /home/me/public/mysite.com/install/index.php on line 103
[11-Mar-2021 04:55:15 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/me/public/mysite.com/install/index.php on line 45
[11-Mar-2021 04:55:17 UTC] PHP Deprecated: Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /home/me/public/mysite.com/install/index.php on line 103
[11-Mar-2021 04:55:17 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/me/public/mysite.com/install/index.php on line 45
[11-Mar-2021 04:55:19 UTC] PHP Deprecated: Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /home/me/public/mysite.com/install/index.php on line 103
[11-Mar-2021 04:55:19 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/me/public/mysite.com/install/index.php on line 45
[11-Mar-2021 04:55:43 UTC] PHP Deprecated: Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /home/me/public/mysite.com/install/index.php on line 103
[11-Mar-2021 04:55:43 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/me/public/mysite.com/install/index.php on line 45
[11-Mar-2021 04:55:47 UTC] PHP Deprecated: Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /home/me/public/mysite.com/install/index.php on line 103
[11-Mar-2021 04:55:47 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/me/public/mysite.com/install/index.php on line 45
[11-Mar-2021 04:56:09 UTC] PHP Deprecated: Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /home/me/public/mysite.com/install/index.php on line 103
[11-Mar-2021 04:56:09 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/me/public/mysite.com/install/index.php on line 45
[11-Mar-2021 04:56:11 UTC] PHP Deprecated: Unparenthesized a ? b : c ? d : e is deprecated. Use either (a ? b : c) ? d : e or a ? b : (c ? d : e) in /home/me/public/mysite.com/install/index.php on line 103
[11-Mar-2021 04:56:11 UTC] PHP Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/me/public/mysite.com/install/index.php on line 45
[11-Mar-2021 04:58:31 GMT] [/, , , mysite.com]
[11-Mar-2021 04:58:37 GMT] [/, , , mysite.com]
[11-Mar-2021 04:58:41 GMT] [/, , , mysite.com]

@jbroadway
Copy link
Owner

Thanks for this! Realizing I have a few more issues to fix before 2.2.6 is ready for release, but this gives me a clue as to what to look at to solve this one, along with another issue I see in the installer too. Will keep you posted, should be working through these over the next week.

@jbroadway
Copy link
Owner

Looking at it now, that looks like neither conf ('General', 'site_domain') nor Appconf::admin ('Site Settings', 'site_domain') is set, which would explain the redirection issues. That would suggest there's a problem reading the conf/app.admin.config.php file, which could be the permissions on the file (needs to be readable by the web server), or maybe it was only partially copied and is failing to be parsed (I would expect an error from that though), or it was saved with a slightly different file name or in a different location. I would double check those and see if that turns up anything.

There've also been a bunch of new fixes on the master branch. I introduced some bugs when I updated the cross-site request forgery logic, but I believe that should all be fixed now.

@kreativmind
Copy link
Author

In the Site Settings (backend), everything is filled in except Google Analytics ID. I think the problem might be the file name. In conf, there is no app.admin.config.php file, only config.php and that file does have the correct settings saved to it and has 777 permissions set to the file.

I can try and do a pull from the master and see if that fixes some issues but I will wait for your reply on this message first before doing so. I am curious about the file name issue I've mentioned or if it's a typo in your previous reply.

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

No branches or pull requests

2 participants