Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: error 404 is actually a bug that should be fixed.  (Read 2899 times)

adminphp

  • Full Member
  • ***
  • Karma: 3
  • Posts: 176
  • you must be a great snewser .
error 404 is actually a bug that should be fixed.
« on: April 01, 2014, 07:22:23 AM »

Hello guys;

I have been thinking for one week, If i should post this bug in snews forum. I beleive that I posted before a thread that matchs with this I proceed to write.

alright, the reason why I beleive this problem can be defined as a bug, is because I have not found out the solution, and there was many snews users, complaining about it, But none of solution were given.

 ok, simpley as this: Google analytics and histats and adsense cpanel, notify that 40-100 pages Crawler access perday :-[. This was caused by error 404 message that appears while visiting the website. The error 404 problem is not at all about the host, or something like:"it's actually there is not a content so that's why it shows error404" . the evidence of what i say, I mean it' has nothing to do with empty content, Is that when I re-visit the same link, bingo, I get the content.

 So, please do you believe this one of those bugs that should be fixed, and can you provide your solution that will be much appreciated. also, my snews is Mysterious, for instance If the content of sent comment that waits to be approved, contains this ('), it will never be approved, the same goes with posting articles, If an article contain this (') it will never work, I meant, be published. what's your opinion guys. this little guy, need your help. ;D
« Last Edit: April 01, 2014, 07:26:09 AM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

nukpana

  • Hero Member
  • *****
  • Karma: 74
  • Posts: 751
Re: error 404 is actually a bug that should be fixed.
« Reply #1 on: April 01, 2014, 12:53:23 PM »

Quote
Google analytics and histats and adsense cpanel, notify that 40-100 pages Crawler access perday :-[. This was caused by error 404 message that appears while visiting the website. The error 404 problem is not at all about the host, or something like:"it's actually there is not a content so that's why it shows error404" . the evidence of what i say, I mean it' has nothing to do with empty content, Is that when I re-visit the same link, bingo, I get the content.
- Can you go more into detail about the issue? Comparison of links being crawled vs what you visiting? Is the content added by Ajax?
 - Can you provide a link to the other complaints?  Perhaps there was code initiated that can be used as a jump start.
 - You are posting on an older version of this script - is it solved in the latest version?  Perhaps code needs to be back-ported.
 - Finally, what have you tried to do to resolve this issue - post your code or the code you believe is causing the issue.

Quote
for instance If the content of sent comment that waits to be approved, contains this ('), it will never be approved, the same goes with posting articles, If an article contain this (') it will never work, I meant, be published.
This is a secondary issue that should be a separate thread.  Ideally, you can add a check if the entered content is less than 5 characters, then do not allow the form to be submitted.
Logged

adminphp

  • Full Member
  • ***
  • Karma: 3
  • Posts: 176
  • you must be a great snewser .
Re: error 404 is actually a bug that should be fixed.
« Reply #2 on: April 04, 2014, 01:31:28 AM »

Hi nukpana;

I am sorry I have not login since I posted this thread, Again i wasn't here to sent a prompt reply.

 Yes, concerning your question: the issue here is that, I got at least 40 pages in  Google analytics says that were " Crawler access" that means the visitors couldn't reach the article/content. I beleive this is a bug, and should be fixed, Nukpana. I have seen many members here, complaining about it, And never saw a way to solve it.

what happen to occur this problem is that, At least when ever I visit an article or a page that wasn't visited for alongtime, I got error 404 that means the content doesn't exist, so when I refresh the page, I get the content and everything is ok. so, I believe that snews file somehow, It can reach to that certain article or page but when I re-visit the same url, the content shows up. I think also, that it is possible to happen this problem for any article, there is not a certain articles/pages. Here to put you in the image, I provide this link that contains my snews file completely, Snews File

I have snews 1.6, and till now I don't know if there are versions too within 1.6. and here is some other posted thread that complain about the same issue:  http://snewscms.com/forum/index.php/topic,10499.0.html   http://snewscms.com/forum/index.php/topic,10458.msg69231.html#msg69231 this is a fix but for 1.7 version http://snewscms.com/forum/index.php/topic,8105.msg57553.html#msg57553
one of the solution I have proceed is http://snewscms.com/faq/faq/#error_02 but never work. thanks nukpana for your help.
Logged
“Fifty years of programming language research, and we end up with C++?”

nukpana

  • Hero Member
  • *****
  • Karma: 74
  • Posts: 751
Re: error 404 is actually a bug that should be fixed.
« Reply #3 on: April 04, 2014, 12:16:52 PM »

the issue here is that, I got at least 40 pages in  Google analytics says that were " Crawler access" that means the visitors couldn't reach the article/content.

what happen to occur this problem is that, At least when ever I visit an article or a page that wasn't visited for alongtime, I got error 404 that means the content doesn't exist, so when I refresh the page, I get the content and everything is ok. so, I believe that snews file somehow, It can reach to that certain article or page but when I re-visit the same url, the content shows up. I think also, that it is possible to happen this problem for any article, there is not a certain articles/pages.
So these are valid links?  Are you getting the 404 error when you initially visit the page (ie not re-visit)?

Quick googling leads me to believe this could may be a caching issue that you may just need to add headers:
Code: [Select]
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
Please test to verify.

If you still believe this is a system issue, please do a fresh installation (http://snewscms.com/download/snews16.zip) and test.

None of the links you provided appear to be relevant to this issue.
« Last Edit: April 04, 2014, 12:22:24 PM by nukpana »
Logged

adminphp

  • Full Member
  • ***
  • Karma: 3
  • Posts: 176
  • you must be a great snewser .
Re: error 404 is actually a bug that should be fixed.
« Reply #4 on: April 04, 2014, 07:44:04 PM »

Yes, i get error 404 for valid link, and when I re-visit (refresh the page) for the same link, I get the content. I beleive this problem is from snews, and not from my browser or the host.

Meta cache control has nothing to do with this issue, I have tested it and never work. I have several times done fresh Installation, but it can just work. I don't know what's the problem about. You can see my snews file and install it, you'll see the problem at yours.
Logged
“Fifty years of programming language research, and we end up with C++?”

nukpana

  • Hero Member
  • *****
  • Karma: 74
  • Posts: 751
Re: error 404 is actually a bug that should be fixed.
« Reply #5 on: April 04, 2014, 11:55:57 PM »

Ok, now that I am more awake, I can see you did spell it out earlier and me giving the meta cache wasn't a good solution at all.

Quote
I have several times done fresh Installation, but it can just work.
Perhaps a translation issue, but does a fresh base install work or does not work?  I want to avoid errors like modification, third party libraries, server config or update. 
Logged

adminphp

  • Full Member
  • ***
  • Karma: 3
  • Posts: 176
  • you must be a great snewser .
Re: error 404 is actually a bug that should be fixed.
« Reply #6 on: April 06, 2014, 12:19:05 AM »

sorry nukpana for the mistake. Yes the fresh installation works ok, but the problem still exist.
Logged
“Fifty years of programming language research, and we end up with C++?”

nukpana

  • Hero Member
  • *****
  • Karma: 74
  • Posts: 751
Re: error 404 is actually a bug that should be fixed.
« Reply #7 on: April 06, 2014, 03:50:57 PM »

sorry nukpana for the mistake.
First, there is no need to apologize. I want you to try and debug this yourself before asking for help because - a) you are using an older version of this script, b) by using this script you should know by modifying the system, the maintenance is mostly on you (ala knowing PHP & mysql well enough to fix and/or isolate issues), and lastly, c) there is not much of community that is active to help out/react to issues (, d) I am only stopping by for a short period of time, I have other work to do, so I may not be able to respond back to this for a while).   By isolating if your problem happens with a default installation rules out a bug on our part or on your side.  This also helps to provide a better avenue for you to search for the specific issue and to write a better problem/bug report if you cannot find an answer.

Quote
Yes the fresh installation works ok, but the problem still exist.
Ok good, but you may not have answered my question fully.  Think of a yes/no flowchart and start asking questions:

Are the live server and local dev servers (home/work computer) identical in version/configuration?
Does the issue happen on the live server or local dev server?
If the issue only happens on the live server, does the issue happen on the local dev server?
Can you try to replicate the issue?
 --- If so, are you running the script with errors on? (Leave the off for the live version!! For dev environments turn them on if not already)
 ----- Is your server configured to display errors? (enable them if no, restart the dev server)
 ------- If so, what errors are being shown?  We are looking for Warning errors (for php errors).
Does the issue show on a default installation? (Isolate default script bug or other issue)
Are you testing the default installation on the server where the issue is happening?
Has there been an update to the live server recently? (Ideally, testing should have been done on the dev side before the update to isolate issues.  This script should be compatible with the latest versions of PHP/MYSQL anyway, but testing should be done regardless)
Has there been an addition to the live server recently?

When did this issue start happening?
(Mod or Third party addon)
Was there a an update to the script done around the time the issue started happening?
If you rollback back to the last backup (before the last update, I hope), does the issue persist?
Was there an update to htaccess prior to this issue?

(Since you are using an older version:)
Does this issue happen with the latest version?
If the issue happens on either the live or dev server - does this issue happen with the latest version on the server that is having the issue?

(Script specific)
Is the issue happening on certain content types only (System Page, User Page, category, or article)?
Are the queries coming out the correct result set on the times these issues happen (see below for debug tip)
Code: [Select]
// Don't use in you live script!!!!!
// This is off the top of my head, sorry if it's wrong.
// based on http://code.google.com/p/snews/source/browse/tags/sNews16/snews.php

// The 404 check happens shortly after the $articleCatID is defined. If the issue happens on the dev server, and on user page/articles, we can see what is being sent back on 404 error pages.

// in fn snews_startup()
//Add 1 line
echo 'categoryID query: <br>';
$categoryID = $categorySEF == $homeSEF ? 0 : retrieve('id', 'categories', 'seftitle', $categorySEF);
// Add 1 line
echo 'articleCatID query: <br>';
$articleCatID = retrieve('category', 'articles', 'seftitle', $articleSEF);

// in fn retrieve
        $query = "SELECT $column FROM ".db('prefix')."$table WHERE $field = '$value'";
// add
echo $query . '<br>';
        $result = mysql_query($query);
        while ($r = mysql_fetch_array($result)) {
// add
echo '<pre>';
print_r($r);
echo '</pre>';

$retrieve = $r[$column];}

There may be more questions, but I am heading out.  There are many of questions here that only you can answer and I cannot just by downloading your version of the script.   
« Last Edit: April 06, 2014, 03:54:02 PM by nukpana »
Logged

adminphp

  • Full Member
  • ***
  • Karma: 3
  • Posts: 176
  • you must be a great snewser .
Re: error 404 is actually a bug that should be fixed.
« Reply #8 on: April 08, 2014, 01:03:30 AM »

Ok nukpana It's seems there are alot of questions you've posted, some of them, i would answer, but others I have not tested them yet. So, I will follow everything you said here, And I will report the final debug. I didn't thought that all these things could cause this issue. i have provided the snews file so that you can, tested it there, if it works with no error 404, I'll be sure that The problem is in my server, not in snews file. But, nukpana, thanks so much for your help, I'll back soon as I'll test all these things to see.

THANKS Again and If you have FACEBOOK you can give it to me, so that I'll notify you, in condition you are not visiting this community, in coming days.
« Last Edit: April 08, 2014, 01:05:47 AM by adminphp »
Logged
“Fifty years of programming language research, and we end up with C++?”

nukpana

  • Hero Member
  • *****
  • Karma: 74
  • Posts: 751
Re: error 404 is actually a bug that should be fixed.
« Reply #9 on: April 21, 2014, 12:56:13 PM »

Ok nukpana It's seems there are alot of questions you've posted, some of them, i would answer, but others I have not tested them yet. So, I will follow everything you said here, And I will report the final debug. I didn't thought that all these things could cause this issue.  i have provided the snews file so that you can, tested it there, if it works with no error 404, I'll be sure that The problem is in my server, not in snews file.
Well, the idea is isolating the problem.  Some of these are simple yes/no questions like:
- did you update the script (yes/no),
- did the issue start happening after the script was updated (yes/no),
- did you backup before you updated the script (yes/no),
- - if you did, when you restored the backup does the issue persist (yes/no)
- does this happen on pages? (yes/no),
- does this happen on categories? (yes/no),
- is there anything different with the articles that are getting the initial 404 (yes/no),
- you noted this is content you haven't visited in some time, are the 404 articles older than the other articles (yes/no)?
- - is the 404 content, the oldest articles you have?
- etc, etc, etc

Again, this is something I can't see just by looking at your file.  Also, if the problem is on your server, then does the issue happen on your local development environment - again only you can answer. 
Logged