Skip to Content Skip to Menu

[SOLVED] 500 error with expired membership

  • edjec
  • edjec
  • OFFLINE
  • Posts: 132
  • Thanks: 12
  • Karma: 3
  • Add-ons
6 years 10 months ago - 6 years 9 months ago #300349 by edjec
We recently migrated from J2.5 to J3.8 and have discovered that after a subscription expires and the member logs in, clicking any menu item restricted to active members (other than renewal) will throw a 500 error page instead of the notice that the page is restricted to active members only. Clicking the back button on the browser will properly display Message: Access to this menu item not allowed without Membership. All public menu items respond properly.


The URL for the error pages are over 7,600 characters in length similar to the following example:

oursite.org/index.php/members/profile/public-profile/pluginclass/cbpaidsubscriptions?do=accessdenied&accesstype=menus&accessvalue=165&accessurl=ZG89YWNjZXNzZGVuaWVkJmFjY2Vzc3R5cGU9bWVudXMmYWNjZXNzdmFsdWU9MTY1JmFjY2Vzc3VybD1aRzg5WVdOalpYTnpaR1Z1YV1 (and on and on for another 7,600 characters!)

I assume the 500 internal server errors are because the urls can't be resolved, but where are these urls coming from?

Any idea as to what might be causing this?

Thanks,

Ed

J 3.8.3, CB 2.1.3, CB Subs 4.1.1
Last edit: 6 years 9 months ago by krileon. Reason: Added [SOLVED] tag to subject

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 10 months ago #300381 by krileon
Replied by krileon on topic 500 error with expired membership
It's odd the URL is so long. What are you trying to protect? That looks like By URL Part protection doing a partial match to a URL. By URL Part protection passes the entire URL base64 encoded back to CBSubs so it can decode and further perform checks as well as redirect back as needed and is what &accessurl is. Believe it doesn't need to do this for menu protections.

URL length limits have changed quite a bit. The standard is to not go over 2083 characters, but modern browsers can handle significantly more than that these days (several thousands) in addition to minimum apache limit is around 4000 (usually always set much higher than that). If browser limit is hit the browser would terminate the request and tell you why (you'd never make it to the site). If the server cut it off you'd just end up at the wrong place (that parameter is added last before the important navigation params).

Suggest enabling debug mode and maximum error reporting in Joomla global configuration then retrying to see what errors are being output. If none please check server error log around time of your test for any fatal errors.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • edjec
  • edjec
  • OFFLINE
  • Posts: 132
  • Thanks: 12
  • Karma: 3
  • Add-ons
6 years 10 months ago #300410 by edjec
Replied by edjec on topic 500 error with expired membership
I checked the plan's configuration and there are no extension protections, i.e.; url, component or modules. There are menu, content and category restrictions though and it is on these that the errors appear.

I hesitate to turn on debug and error reporting on the live site, but did so on my dev server and the results are following. However, the dev server does not display the site's 500 error page, but instead a browser 414 error as below, which confirm your suspicions:
Submitted URI too large!
The length of the requested URL exceeds the capacity limit for this server. The request cannot be processed.
If you think this is a server error, please contact the webmaster.
Error 414:




Turning on Joomla Debug shows nothing and error reporting only displays one depricated warning: Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; plgSystemDtjeventupdate has a deprecated constructor in \plugins\system\dtjeventupdate\dtjeventupdate.php on line 18

The Apache access log displays the entire url which is always accessdenied&accesstype=menus&accessvalue: [18/Dec/2017:11:13:52 -0700] "GET /index.php/members/profile/public-profile/pluginclass/cbpaidsubscriptions?do=accessdenied&accesstype=menus&accessvalue=165&accessurl=ZG89YWNjZXNzZGVuaWVkJmFjY2Vzc3R5cGU + thousands more...

The Apache error log shows:
[Mon Dec 18 11:13:52.895423 2017] [:error] [pid 65664:tid 1244] [client 127.0.0.1:62048] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; plgSystemDtjeventupdate has a deprecated constructor in \\plugins\\system\\dtjeventupdate\\dtjeventupdate.php on line 18, referer: https://localhost/site/index.php/members/profile/public-profile/pluginclass/cbpaidsubscriptions?do=accessdenied&accesstype=menus&accessvalue=165&accessurl=ZG89YWNjZXNzZGVuaWVkJmF...

We have used these or similar protections since 2011 and have never experienced this issue and the plans did not change through the migration. It is only after recent Joomla updates that these were discovered. Could Joomla in some way be causing this?

Thanks for your assistance,

Ed

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 10 months ago #300415 by krileon
Replied by krileon on topic 500 error with expired membership
Ok, in that case accessurl is the URL they're coming from. It's sent to CBSubs so CBSubs can send them back to it. I've no idea why this is suddenly causing errors, but I suspect it has nothing to do with CBSubs or the URL length. There's likely a conflict coming from elsewhere or a routing problem in Joomla it self. Try turning off SEF entirely and see if issue persists.

As for your notice it's a deprecation notice in dtjeventupdate system plugin, which shouldn't cause any issues but I'm not the developer of that extension so I've no idea. Try unpublishing dtjeventupdate in Extensions > Plugins and see if that helps.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • edjec
  • edjec
  • OFFLINE
  • Posts: 132
  • Thanks: 12
  • Karma: 3
  • Add-ons
6 years 10 months ago #300428 by edjec
Replied by edjec on topic 500 error with expired membership
Bingo!

Turning off SEF in Global Settings corrected the issue and now the correct message and renewal screen are displayed when clicking on a restricted menu item.

The server error file shows:
[18-Dec-2017 22:20:48 UTC] PHP Fatal error: Call to undefined method Joomla\CMS\Document\FeedDocument::addFavicon() in /home/vcoaor5/public_html/templates/jd_dallas/error.php on line 27

Which is this from the site template:
Code:
//Favicon if($favicon = $params->get('favicon')) { $doc->addFavicon( JURI::base(true) . '/' . $favicon); } else { $doc->addFavicon( $this->baseurl . '/templates/' . $this->template . '/images/favicon.ico' ); }

I don't see how this could cause the issue, but I disabled it anyway retested the protected menu items with SEF enabled. I received the same 500 errors, so this had no effect.

So, turning off SEF does correct the issue, but creates an even worse situation where any SEF url links will now fail. I re-enabled SEF to avoid broken links.

SEF settings in the .htaccess file are standard Joomla and haven't changed:
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]


BTW:
Use URL Rewriting, Add Suffix to URL and Unicode Aliases are all set to No in Global Settings.

Do you have any more suggestions of how to diagnose this further?

Thanks,

Ed

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 10 months ago #300437 by krileon
Replied by krileon on topic 500 error with expired membership
Are you using Joomla SEF or 3rd party SEF? Ensure your htaccess rewrite rules are up to date with Joomla then set "Use URL Rewriting" to "Yes" in Joomla global settings and retry. Please also test with Joomla default protostar template to rule out template issues. Please be sure everything (including any used Joomla extensions, templates, etc..) is completely up to date to rule out conflicts. Fatal errors of any kind can certainly interfere with processes.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum