Transient 404 on link to Community Submit link….

Home Forums Calendar Products Events Calendar PRO Transient 404 on link to Community Submit link….

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #930564
    Dennis Freeze
    Participant

    Howdy. Another small glitch is happening on my migration: I am occasionally getting a 404 error when following the link to my Community Event Submission page. Every time it’s happened, simply refreshing the page has yielded the proper page. It’s happening maybe 1 out of 6-8 times. My link, in this case, is http://www.kozt.com/calendar/community/add/, and it works most of the time. I even put the trailing slash on the link target, but it doesn’t make a difference.

    Any idea how to debug this one? No obvious errors happening, other than the 404. I’m using the Error log Dashboard Widget, and nothing is being logged….

    Thanks,
    Dennis

    p.s. My client is really liking the new plugin’s usability!

    #931578
    Brook
    Participant

    Howdy Dennis,

    I don’t know why my reply here from Friday is missing. But it is! Perhaps I closed the page too quickly after clicking “Submit”? My apologies.

    That is positively odd. Intermittent issues are never fun to get to the bottom of. My primary suspect would be a caching solution. But, even then it is a bit strange that it is so intermittent. The only way I can think of to troubleshoot this is a standard Conflict Test. But, since you have to try it 8 or so time to get the 404, the conflict test is going to be a bit painful. I wish there was another way, I am trying to think of one. But, this really does seem like our only useful diagnostic at the moment. If you have a caching plugin, I’d try that one first.

    https://theeventscalendar.com/knowledgebase/testing-for-conflicts/

    Would that work? Do you have any other questions? Please let me know. Cheers!

    – Brook

    #931767
    Dennis Freeze
    Participant

    Brook,

    Well, I’m not using any caching plugins, so that’s definitely not the cause. I tried regenerating permalinks and clearing browser cache, but no luck.

    No Javascript errors happen when it occurs, either.

    I’ll have to do the disabling plugins thing during off-hours, so it may be a day or 2 before I can get to it.

    Thanks,
    Dennis

    #932426
    Brook
    Participant

    Thanks for the update Dennis. I do wish there was an easier way. Doing it during off hour is a good call. Typically I try to do tests like this on my development server, not my live one. But, not everyone has a development server.

    Let me know if I can be of help. Cheers!

    – Brook

    #934875
    Dennis Freeze
    Participant

    Brook,

    This error didn’t happen at all on my development server — it only manifested when I went live on the production server. 🙁

    I’m planning to do the 404 testing tomorrow afternoon, Tues Jan 20th…. I had to clear a time with the radio station to have their site down for a while….

    Dennis

    I’ll start here: https://theeventscalendar.com/knowledgebase/fixing-http-404-errors/

    #934890
    Brook
    Participant

    Well that makes life difficult. Sorry to hear that. It’s good to know though, every little bit of information helps. Keep us posted as to the result of your test. Cheers!

    – Brook

    #935899
    Dennis Freeze
    Participant

    OK, I turned off all plugins and reverted to the 2015 theme. I found 2 things causing 404 errors:

    1. An apparent bug in your code is resulting in some bad links when clicking on an event in the monthly calendar. If you look at http://www.kozt.com/calendar, it’s the “Little Lake Grange” event on Jan 26. The generated link for this page is http://www.kozt.com/event/2015-01-25/, and this results in a 404 error. This happens with everything else turned off, using the 2015 theme. The event itself looks just like all the others….

    2. I believe that the 404 errors are because of a conflict with another plugin –the Background Music Player. This shows up when a 404 error is generated — either because of the bad link in the previous example, or occasionally when clicking on http://www.kozt.com/calendar/community/add/ to submit an event. When the WP_DEBUG flag is true, then I get the same error message with either cause of the 404:

    Trying to get property of non-object in /data/www/html/k/kozt.com/www/wp-content/plugins/background-music-player/public/background-music-player.php on line 631

    This plugin is vital to the site — it plays the radio station’s live stream. Any ideas on how to figure out the situation? The referenced file does a bunch of includes, though, so I can’t easily tell where the error happens.

    I’m pretty sure this is it. With everything disabled except your plugins, I could not make the error happen. Whenever I turn on the Background Music Player plugin, it happens pretty quickly when I click on the Add Community Event link.

    Thanks,
    Dennis

    p.s. Do you guys need a login and Adminer to look at things in the backend? Have you heard of any previous issues with the Background Music Player? http://docs.circlewaves.com/background-music-player/

    Here’s what was logged to the Debug Bar with the 2 different kinds of 404s:

    Logged in Debug Bar when a 404 error occurred when trying to go to http://www.kozt.com/event/2015-01-25/
    Request:
    event/2015-01-25
    Query String:
    tribe_events=2015-01-25&post_type=tribe_events&name=2015-01-25
    Matched Rewrite Rule:
    event/([^/]+)(/[0-9]+)?/?$
    Matched Rewrite Query:
    tribe_events=2015-01-25&page=

    From <http://www.kozt.com/event/2015-01-25/&gt;

    Logged in Debug Bar when going to /calendar/community/add/
    Request:
    calendar/community/add
    Query String:
    pagename=calendar%2Fcommunity%2Fadd
    Matched Rewrite Rule:
    (.?.+?)(/[0-9]+)?/?$
    Matched Rewrite Query:
    pagename=calendar%2Fcommunity%2Fadd&page=

    From <http://www.kozt.com/calendar/community/add/&gt;

    #936057
    Brook
    Participant

    That is very useful information dff4kozt.  Thanks for sharing all the details.

    Regarding your first issue, that sounds like an error we have seen crop up when a plugin is deactivated/activated. If it ever happens again simply flushing your permalinks should fix it. We plan to fix those though in the near future, making it so you will not even have to flush your permalinks.

    Now for issue number two. I would guess that Background Music Player’s rewrite rules are conflicting with the calendars, causing the 404. In such a case there is one solution that is almost guaranteed to work, switching away from pretty permalinks. Go to WP Admin > Settings > Permalinks, and change your settings to Default to do this. It is likely the conflict will go away. But unfortunately this will change the URL structure of your site. You will also need to create a new page for submitting events, and add the shortcode [tribe_community_events] to that page.

    Other than that you will need to make modifications to your rewrite rules to remove any conflicts. This will not be easy and would require an intimate understanding og rewrites. But you can scan the $wp_rewrites objects for conflict rules, and right your own function to modify them removing the conflicts.

    Will one of those options work? Do you have any more questions? Please let me know. Thanks!

    – Brook

    #937719
    Dennis Freeze
    Participant

    Brook,

    OK, I’ve flushed the permalinks cache, so hopefully that error will go away.

    Regarding the transient 404s, I am not sure how to proceed. I really don’t think I can change the permalink structure for the site, especially to revert back to using the most crude version. When I switched this site to WordPress, I had to do a lot of redirects for old pages. Adding another set for everything is a huge load, and I’d still have the ugliest links.

    I’ve never poked into how WordPress handles rewrites. I think I’ll see if anybody from the other plugin has encountered this before I start mucking around in the rewrite mechanism. Do you have anything written up about how your plugin handles rewrites?

    Thanks,
    Dennis

    #937721
    Dennis Freeze
    Participant

    Brook,

    Are there any common points of conflict with other plugins? You’ve probably experienced other conflicts, and maybe there’s something else going on. It certainly seems like a slam-dunk as far as being in the URL rewriting area, but who knows? There could be an error upstream of that action, and the rewrite could just be the point where the failure shows up….

    It seems like your plugin does a really good job of playing by the rules, so I’m guessing there are not many instances of conflicts — but helping narrow down the problem is good, and I might even get lucky with it if there’s a common pattern.

    Thanks,
    Dennis

    #937919
    Brook
    Participant

    You are asking all the right questions Dennis. You are definitely headed in the right direction for a solution, but unfortunately the road might still be a long one.

    I think I’ll see if anybody from the other plugin has encountered this before I start mucking around in the rewrite mechanism. Do you have anything written up about how your plugin handles rewrites?

    I do not have anything like that. In community the logic is a bit abstracted inside of the class WP_Route ( /the-events-calendar-community-events/vendor/wp-router/WP_Route.class.php ) . We call that via TribeCommunityEvents::addRoutes(). What you do need to know is that this is the proper route for the community events add page is this:

    Request:
    events/community/add
    Query String:
    WP_Route=ce-add-route
    Matched Rewrite Rule:
    ^events/community/add$
    Matched Rewrite Query:
    WP_Route=ce-add-route

    Are there any common points of conflict with other plugins? You’ve probably experienced other conflicts, and maybe there’s something else going on. It certainly seems like a slam-dunk as far as being in the URL rewriting area, but who knows?

    Great questions. We can be rather certain that you’ve isolated the problem to the rewrite rules. Compare your results with the proper ones above. Your results would naturally return a 404 because there is no WP Page (which is a type of WP post) with the slug “calendar community add”, and thus the query string/rewrite that matched “pagename=calendar%2Fcommunity%2Fadd” would return a 404. We need to correct the query string and make sure it stays corrected. You might could write your own rewrite rule which forwards “events/community/add” to “WP_Route=ce-add-route”m and have it run with a super late priority in the hope that it will overwrite anty other rule inclucding your other plugins. But, I can not say for sure if this will fix the problem, just that it’s worth a shot. Furthermore you should also delete any page with the short code “[tribe_community_events]” on the off chance that it might be interfering.

    Does that answer your questions? Please let me know if you have any more. Cheers!

    – Brook

    #938579
    Dennis Freeze
    Participant

    Brook,

    OK, I’ve heard back from the music player support team, and they asked me to clone the site to a subdomain, and then they will debug it on there. I passed along your info about how your plugin handles rewrites, since that could help them narrow it down quickly.

    It’s going to take a few days to get things set up — the ISP is a small one that doesn’t provide a cPanel i/f, so I have to wait for them to clone the site. I’d appreciate it if we could leave this ticket open for a week or so while the music player guy works on it. I’ll report back if they find anything they can’t fix.

    Thanks,
    Dennis

    #938956
    Brook
    Participant

    Thanks for the update, Dennis. I will await your response.

    – Brook

    #963092
    Brook
    Participant

    Since this topic has gone for a spell without an update it is being archived. If you need further assistance, feel free to open a new topic. We would be happy to help. Cheers!

    – Brook

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Transient 404 on link to Community Submit link….’ is closed to new replies.