• The issue occurs for both PostreSQL and MySQL
  • The issue occurs by failure of retrieving a record from node_revisions where nr.nid = %nid and failure to retrieve a record from comments where c.nid = %nid and c.status = COMMENT_PUBLISHED.
  • The proposed fix in comment 66 ensures that if no rows were returned from the DB the changecount is 0 instead of -1.
  • The question becomes why no rows are being returned for $query = db_query("SELECT nr.timestamp FROM {node_revisions} nr WHERE nr.nid = %d", $node->nid);?

Original Issue Post

Hi!

I gave the following errors after node creation, however the created node appear in the sitemap.xml. I'm using postgresql-8.3.7, php-5.2.10, xmlsitemap-6.x-2.x-dev (11-july-2009) and drupal-6.13.

    * warning: pg_query() [function.pg-query]: Query failed: ERROR: value for domain int_unsigned violates check constraint "int_unsigned_check" in /adat/3w/postgres/includes/database.pgsql.inc on line 139.

    * user warning: query: INSERT INTO xmlsitemap (id, type, loc, access, status, lastmod, priority, priority_override, changefreq, changecount, node_type) VALUES (2, 'node', 'node/2', 1, 1, 1247408591, NULL, NULL, 0, -1, 'page') in /adat/3w/postgres/sites/all/modules/xmlsitemap/xmlsitemap.module on line 805.
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Status: Active » Fixed

I tested the module with pgsql and confirmed this error happens with new nodes because the -1 value is inserted into the node/add form. I committed a fix to CVS and left an error check just in case this pops up again.
http://drupal.org/cvs?commit=236870

mrfelton’s picture

I just got the following message when going to the page /node/add/blog-post:

user error: Changecount for node was negative (timestamps: . Please report this to http://drupal.org/node/516928. in /home/tom/workspace/concern6/sites/example.com/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module on line 296.

EDIT: That was with xmlsitemap-6.x-2.x-dev.tar.gz downloaded this afternoon

Dave Reid’s picture

@mrfelton: I know that the error on node creation should be fixed with the latest commit (http://drupal.org/cvs?commit=237046) which should be included the next time the development build is regenerated. It didn't quite make it with the commit in #1.

gregarios’s picture

I'm getting this PHP error, and it tells me to go here to report it:

Changecount for node was negative (timestamps: . Please report this to <a href="http://drupal.org/node/516928">http://drupal.org/node/516928</a>. in /usr/local/apache2/vhosts/<mywebsite.com>/htdocs/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.module on line 296.

I'm not even using PostgreSQL at all. I'm using MySQL.

I'm running FreeBSD 6.3, Drupal 6.13, MySQL 5.0.75, PHP 5.2.9, Apache 2.2.11

Dave Reid’s picture

@gregarios: Same response as #3. Been fixed already, will be included in next dev build.

gregarios’s picture

Oops... ok I didn't see that. Thanks. :-)

Dave Reid’s picture

@gregarios: No problem! I'm kicking myself for not getting the followup fix in before the module was repackaged. I think the next one should be ready in less than an hour.

xmarket’s picture

Hi!

The originally reported error message disappeared, but I'm gave the message which reported in #2. I will test again tomorrow with the new nightly build.

eyecon-1’s picture

I am not using PostgreSQL but note the following message printed to the syslog:

Jul 15 16:03:02 gaynewsservice drupal: http://www.tips-q.com|1247688182|php|68.236.166.73|http://www.tips-q.com/node/add/blog|http://www.tips-q.com/node/add/blog|1||Changecount for node was negative (timestamps: . Please report this to http://drupal.org/node/516928.

Reported as requested -;)

OS=CentOS 5.3
Webserver=Lighty
PHP=5.2x (custom RPM)
DB=MySql 5.0.45

I don't know if this is pertinent, but every cron run prunes stale aggregated content.

Dave Reid’s picture

Well I'm glad that everyone actually read the debugging message I put in. :) Everyone please make sure you are using the absolute latest 6.x-2.x development build and report back here if you do or do not see any more warnings.

@eyecon XML sitemap has nothing to do with cron removing stale aggregator content.

eyecon-1’s picture

Version=6.x-2.x-dev (2009-Jul-13)

Dave Reid’s picture

Hmm.... my latest commit for this issue seems to have not triggered the development build script. I'll make a dummy commit to get it to repackage.

Dave Reid’s picture

Ok everyone. The 6.x-2.x-dev was finally repackaged with the desired changes. Please re-download and test it out. Be sure to test the node/add pages since that's where the problem is coming from.

xmarket’s picture

Version 6.x-2.x (2009-jul-16) works like a charm! Yeah XD.... Thanks for the great and FAST work!

Dave Reid’s picture

@xmarket Woot! Thanks for reporting back!

atan’s picture

http://drupal.org/node/518090

" * user warning: Unknown column 'access' in 'where clause' query: SELECT COUNT (id) FROM WHERE xmlsitemap access = 1 AND status = 1 in / home / content /**/***/**/*********/ html / modules / xmlsitemap / xmlsitemap.module on line 326 ".

Dave Reid’s picture

@atan: That's not related to this issue, but make sure to run update.php. That will create the column.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Oleksa-1’s picture

I use last dev version (not upgrade, this is new installation). When I clicked " Rebuild " - I got :

# user error: Negative changecount value. Please report this to http://drupal.org/node/516928.
array ( 'type' => 'node', 'id' => '18', 'subtype' => 'story', 'loc' => 'node/18', 'status' => 1, 'status_default' => 1, 'status_override' => 0, 'priority' => 0.5, 'priority_default' => 0.5, 'priority_override' => 0, 'changefreq' => 0, 'changecount' => -1, 'lastmod' => '0', 'access' => true, 'language' => '', ) in /home/mysite/public_html/sites/all/modules/xmlsitemap/xmlsitemap.module on line 488.
# user error: Negative changecount value. Please report this to http://drupal.org/node/516928.
array ( 'type' => 'node', 'id' => '19', 'subtype' => 'story', 'loc' => 'node/19', 'status' => 1, 'status_default' => 1, 'status_override' => 0, 'priority' => 0.5, 'priority_default' => 0.5, 'priority_override' => 0, 'changefreq' => 0, 'changecount' => -1, 'lastmod' => '0', 'access' => true, 'language' => '', ) in /home/mysite/public_html/sites/all/modules/xmlsitemap/xmlsitemap.module on line 488.
Dave Reid’s picture

Assigned: Unassigned » Dave Reid
Status: Closed (fixed) » Active

Looking back into this.

Oleksa-1’s picture

And a bit more info. It is about another site, when I tried to upgarade it (update.php) I goo on screen:
Update #4

* Failed: The {xmlsitemap}.language field does not yet exist. Please re-run the update script.

Then I re-run script and got:

user warning: Column 'language' cannot be null query: UPDATE xmlsitemap SET language = (SELECT node.language FROM node WHERE node.nid = xmlsitemap.id AND node.language <> '') WHERE xmlsitemap.type = 'node' in /home/mysite/public_html/sites/all/modules/xmlsitemap/xmlsitemap_node/xmlsitemap_node.install on line 74.

The following queries were executed
xmlsitemap_node module
Update #4

* Failed: UPDATE {xmlsitemap} SET language = (SELECT {node}.language FROM {node} WHERE {node}.nid = {xmlsitemap}.id AND {node}.language <> '') WHERE {xmlsitemap}.type = 'node'

And when post comments, error message appears:
* user warning: Unknown column 'language' in 'field list' query: SELECT loc, access, status, lastmod, priority, changefreq, changecount, language FROM xmlsitemap WHERE type = 'node' AND id = 2299 LIMIT 0, 1 in /home/my site/public_html/sites/all/modules/xmlsitemap/xmlsitemap.module on line 492.
* user warning: Duplicate entry '2299-node' for key 'PRIMARY' query: INSERT INTO xmlsitemap (id, type, loc, access, status, lastmod, priority, priority_override, changefreq, changecount, menu_name, node_type, term_vid) VALUES (2299, 'node', 'node/2299', 1, 1, 1251322230, NULL, 0, 151613, 2, NULL, 'blog', NULL) in /home/mysite/public_html/sites/all/modules/xmlsitemap/xmlsitemap.module on line 836.

skyredwang’s picture

I update XML Sitemap Dev to Sept.1st, click rebuild, got this

user error: Negative changecount value. Please report this to http://drupal.org/node/516928.
array ( 'type' => 'node', 'id' => '45727', 'subtype' => 'forum', 'loc' => 'node/45727', 'status' => 1, 'status_default' => 1, 'status_override' => 0, 'priority' => 0.5, 'priority_default' => 0.5, 'priority_override' => 0, 'changefreq' => 0, 'changecount' => -1, 'lastmod' => '1235439885', 'access' => false, 'language' => '', ) in /home/greatbre/public_html/sites/all/modules/xmlsitemap/xmlsitemap.module on line 488.
Dave Reid’s picture

Status: Active » Fixed

Went and double checked with the latest code using PostgreSQL and I couldn't duplicate. Fixed the "Column 'language' cannot be null query" in #4 though.

Oleksa-1’s picture

Thx, Dave, seems it really fixed. at least i do not see any error messages.

atan’s picture

tnx DR,

Once I did update with the new Drupal version 6.14, I tried to activate cron manually.I post new issue http://drupal.org/node/589092 Any help is appreciated.
standby for answer!
atan,

Oleksa-1’s picture

@atan
I am not sure, but in realise notes it is mentioned:

Upgrading from any other version to 6.x-2.x-dev is NOT currently supported. To use this version you MUST disable and uninstall any current XML sitemap modules!

May be try to remove old version xmlsitemap completly and make new installation. Regarding me i do not have any problem with cron.

Dave Reid’s picture

@atan: The xmlsitemap_user is not part of the 6.x-2.x version, so you have a mix of old and new files in there. Please clear out the entire sites/all/modules/xmlsitemap directory and re-download the 6.x-2.x version.

atan’s picture

Thanks for the quick reply oleksa and DR.

Whether module xmlsitemap_user, I can remove the deletion from the server,because I can not uninstall.I have hosting on godaddy, where Drupal is problematic again re-download the 6.x-2.x version.Ili might not know how.

Dave Reid’s picture

@atan: Did using a fresh xmlsitemap module folder and files fix this problem for you?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

drupalfan2’s picture

Status: Closed (fixed) » Active

I get this error on every manuel cron run (perhaps normal cron run too):

user error: Negative changecount value. Please report this to http://drupal.org/node/516928.

Fresh installation. 6.x-2.0-beta1
What can I do?

Dave Reid’s picture

Status: Active » Postponed (maintainer needs more info)

There should have been more to the error message that you didn't copy & paste here. Can you do that please?

drupalfan2’s picture

Yes, I will write more.

I have never used XML sitemap before. I installed XML sitemap on a multi site installtion of Drupal with about 3 domains. This is running now for about 2 days.

On 2 domains (same multi site installation) there are no errors.

On 1 domain I get this error (see above) when cron is run or every time I run cron manuall in drupal report center.
Version 6.x-2.0-beta1.

I had to reindex search on this domain, but I don't know if this matters.
On this domain the generated xml sitemap is greater then on the other domains of the same installation: 2 xml sitemap urls, ~5000 urls, ~1200 urls (2 parts of same sitemap).

What other information can I provide here?
Is it possible to "hack out" this error message? Is this a critical error or not? Thank you very much.

gregarios’s picture

@DrupalFan2: I believe what Dave Reid needs is a copy of the exact error message as written to your server's error logs, not the error as displayed in your browser.

drupalfan2’s picture

Here the exact error message:

user error: Negative changecount value. Please report this to http://drupal.org/node/516928.
array ( 'id' => '14', 'type' => 'node', 'subtype' => 'forum', 'loc' => 'node/14', 'language' => 'de', 'access' => true, 'status' => '1', 'status_override' => '0', 'lastmod' => '1265240744', 'priority' => '0.5', 'priority_override' => '0', 'changefreq' => 0, 'changecount' => -1, 'status_default' => '1', 'priority_default' => '0.5', ) in /home/drupal/www/sites/all/modules/xmlsitemap/xmlsitemap.module on line 616.

What is this changecount for and why is it not allowed to be negative?

kerberos’s picture

Not sure if this helps, but this is under MySQL 5:

*****************

Negative changecount value. Please report this to http://drupal.org/node/516928.array (
&#039;type&#039; =&gt; &#039;node&#039;,
&#039;id&#039; =&gt; &#039;81626&#039;,
&#039;subtype&#039; =&gt; &#039;logo&#039;,
&#039;loc&#039; =&gt; &#039;node/81626&#039;,
&#039;status&#039; =&gt; 0,
&#039;status_default&#039; =&gt; 0,
&#039;status_override&#039; =&gt; 0,
&#039;priority&#039; =&gt; 0.5,
&#039;priority_default&#039; =&gt; 0.5,
&#039;priority_override&#039; =&gt; 0,
&#039;changefreq&#039; =&gt; 0,
&#039;changecount&#039; =&gt; -1,
&#039;lastmod&#039; =&gt; 1274878925,
&#039;access&#039; =&gt; true,
&#039;language&#039; =&gt; &#039;&#039;,
) in sites/all/modules/contributed/xmlsitemap/xmlsitemap.module on line 616.

-Daniel
Urbo

Dave Reid’s picture

I'll test the latest code with PostgreSQL, but I'm guessing if you're hitting this condition, your node is missing data in the {node_revision} table, which indicates a much bigger problem.

Dave Reid’s picture

Should be able to test this yourself if you do this SQL query and you get any results, then you have messed up data:
SELECT n.nid, n.type, n.title FROM node n LEFT JOIN node_revisions nr USING (nid) WHERE nr.vid IS NULL

drupalfan2’s picture

hello,

I did this test
SELECT n.nid, n.type, n.title FROM node n LEFT JOIN node_revisions nr USING (nid) WHERE nr.vid IS NULL

and I got an empty result.

Further on I get error messages like this with every cron cycle in drupal reporting:
Negative changecount value. Please report this to http://drupal.org/node/516928.
array ( 'id' => '24', 'type' => 'node', 'subtype' => 'forum', 'loc' => 'node/24', 'language' => 'de', 'access' => true, 'status' => '1', 'status_override' => '0', 'lastmod' => '1265240743', 'priority' => '0.5', 'priority_override' => '0', 'changefreq' => 0, 'changecount' => -1, 'status_default' => '1', 'priority_default' => '0.5', ) in /home/drupal/www/sites/all/modules/xmlsitemap/xmlsitemap.module in Zeile 616.

I do NOT use PostgreSQL, I am using mysql 5.0.51.

Is there a way to get rid of this error message?
Does xml sitemap work correct despite this error?

drupalfan2’s picture

Status: Postponed (maintainer needs more info) » Active
lionstone’s picture

I'm also suffering from this issue:

WD php: Negative changecount value. Please report this to http://drupal.org/node/516928.array (                                                       [error]
  'type' => 'node',
  'id' => '83284',
  'subtype' => 'event',
  'loc' => 'node/83284',
  'status' => 1,
  'status_default' => 1,
  'status_override' => 0,
  'priority' => '0.5',
  'priority_default' => '0.5',
  'priority_override' => 0,
  'changefreq' => 0,
  'changecount' => -1,
  'lastmod' => 1278975834,
  'access' => false,
  'language' => '',
) in /home/clients/websites/w_5wbvmr/repo/docroot/sites/all/modules/xmlsitemap/xmlsitemap.module on line 616.

Thanks for your hard work on the module!

Dave Reid’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

I still can't reproduce this so moving this to a support request until we can narrow down what's wrong.

aacraig’s picture

I was getting the same error when programatically creating a node.

When I correctly inserted it, the error went away.

I was mistakenly passing an array as the 'body' property to the node, which caused a number of errors. When I fixed this issue, the xmlsitemap error went away. I'm not sure if this is because the body was empty or an array at the time xmlsitemap got to it.

To summarize:

This code provokes the error.

  $node = array(
    'uid'       => 1,
    'type'      => $type,
    'language'  => $language
  );
  
  $node = (object)$node;
  node_object_prepare(&$node);

  $node->body = array('some text');
  node_save($node);

This code does not.

  $node = array(
    'uid'       => 1,
    'type'      => $type,
    'language'  => $language
  );
  
  $node = (object)$node;
  node_object_prepare(&$node);

  $node->body = 'some text'; // fixing wrong parameter type 
  node_save($node);
Dave Reid’s picture

Awesome detective work aacraig! Can anyone else confirm this is the same problem for them?

Anonymous’s picture

Too bad we don't have a is_valid_node_object() API to call. But core expects the node object to remain sane without needing to worry about the data types in it.

Dave Reid’s picture

Status: Postponed (maintainer needs more info) » Fixed

Marking as fixed as no one else has responded and we have figured out the issue in #43.

beumont’s picture

I am getting:

user warning: unknown column 'max_filesize' w field list query: INSERT INTO xmlsitemap_sitemap (smid, context, updated, links, chunks, max_filesize) VALUES ('NXhscRe0440PFpI5dSznEVgmauL25KojD7u4e9aZwOM', 'a:0:{}', 0, 0, 0, 0) in /home/users/thomasit/public_html/includes/common.inc on line 3477.

its not working, i can not generate a XML sitemap, can anybody help me with that ?

Their is also a message in the report:

user warning: unknown column 'max_filesize' w field list query: SELECT MAX(max_filesize) FROM xmlsitemap_sitemap in /home/users/thomasit/public_html/sites/default/modules/xmlsitemap/xmlsitemap.install on line 81.

Dave Reid’s picture

@beumont: Make sure to run update.php.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

heyyo’s picture

Status: Active » Closed (fixed)
User error: Negative changecount value. Please report this to <a href="http://drupal.org/node/516928">http://drupal.org/node/516928</a>.
array ( 
'type' => 'node'
'id' => '685'
'subtype' => 'image'
'loc' => 'node/685'
'status' => '1'
'status_default' => '1'
'status_override' => 0
'priority' => '0.4'
'priority_default' => '0.4'
'priority_override' => 0
'changefreq' => 0
'changecount' => -1
'lastmod' => '1293350086'
'access' => true
'language' => 'he'
) in xmlsitemap_link_save() (line 616 of /home/usename/domains/www.mydomain.com/prod/sites/all/modules/xmlsitemap/xmlsitemap.module).

with this error too

User warning: Table 'rimonimisrael.comments' doesn't exist query: xmlsitemap_node_get_timestamps 
/* admin : xmlsitemap_node_get_timestamps */
SELECT c.timestamp FROM comments c WHERE c.nid = 685 AND c.status = 0 UNION ALL SELECT nr.timestamp FROM node_revisions nr WHERE nr.nid = 685 
in _db_query() (line 148 of /home/username/domains/www.mydomain.com/prod/includes/database.mysqli.inc).

I'm not using the comments module anymore

heyyo’s picture

Status: Closed (fixed) » Active
sense-design’s picture

Status: Closed (fixed) » Active

@heyyo: This is fixed in DEV version, just updated to latest DEV

heyyo’s picture

thanks will try it soon

heyyo’s picture

thanks works great.

tonytosta’s picture

My error is slightly different than the one above....

a few of these...

WD php: User error: Negative changecount value. Please report this to [error]
http://drupal.org/node/516928.array (
'type' => 'node',
'id' => '4629',
'subtype' => 'article',
'status' => '1',
'status_default' => '1',
'status_override' => 0,
'priority' => '0.5',
'priority_default' => '0.5',
'priority_override' => 0,
'changefreq' => 0,
'changecount' => -1,
'loc' => 'node/4629',
'lastmod' => 0,
'access' => false,
'language' => '',
) in xmlsitemap_link_save() (line 584 of
[path-to-modules]/modules/contrib/xmlsitemap/xmlsitemap.module).

followed by a


Drush command could not be completed.

Has anyone seen this?

dlumberg’s picture

7.x.2.0-beta3

Message	User error: Negative changecount value. Please report this to http://drupal.org/node/516928.
array ( 'id' => '11920', 'type' => 'node', 'subtype' => 'client', 'loc' => 'node/11920', 'language' => 'und', 'access' => true, 'status' => '0', 'status_override' => '0', 'lastmod' => 0, 'priority' => '0.5', 'priority_override' => '0', 'changefreq' => 0, 'changecount' => -1, 'status_default' => '0', 'priority_default' => '0.5', ) in xmlsitemap_link_save() (line 588 of /path/to/drupal/sites/all/modules/xmlsitemap/xmlsitemap.module).

Looks like it's fixed in dev but I always do what error messages tell me :P

I got a ton of these trying to debug importing nodes with the Feeds module. I haven't had a problem adding nodes normally.

EDIT: Not fixed in 7.x.2.x-dev

djbobbydrake’s picture

Version: 6.x-2.x-dev » 6.x-2.0-beta3

I'm running 6.x-2.0-beta3. Ran xmlsitemap-rebuild drush command and received a similar error:

WD php: User error: Negative changecount value. Please report this to http://drupal.org/node/516928.array ( [error]
'type' => 'node',
'id' => '12305',
'subtype' => 'article',
'status' => '1',
'status_default' => '1',
'status_override' => 0,
'priority' => '0.5',
'priority_default' => '0.5',
'priority_override' => 0,
'changefreq' => 0,
'changecount' => -1,
'loc' => 'node/12305',
'lastmod' => 0,
'access' => false,
'language' => 'en',
) in xmlsitemap_link_save() (line 584 of /sites/all/modules/contrib/xmlsitemap/xmlsitemap.module).

djbobbydrake’s picture

The negative changecount value occurs if the timestamp column in the node revision table is set to ZERO. Changecount is set here in the xmlsitemap_node_create_link function:

$node->xmlsitemap['changecount'] = $node->nid ? count($timestamps) - 1 : 0;

I'm going to fix this by updating the timestamp for any node revision that has a timestamp of ZERO. I believe this timestamp might have been set during a bad import process (we are importing image nodes). What do we think about not causing this negative changecount to trigger an error that causes the sitemap generation process to stop? Rather, what if we just ignore those particular nodes?

lyricnz’s picture

I'm also getting this error. This is happening even though type 'activitystream' is excluded from the sitemaps.

Negative changecount value. Please report this to http://drupal.org/node/516928.
array ( 'id' => '8041',
 'type' => 'node',
 'subtype' => 'activitystream',
 'loc' => 'node/8041',
 'language' => '',
 'access' => true,
 'status' => '0',
 'status_override' => '0',
 'lastmod' => 0,
 'priority' => '0.5',
 'priority_override' => '0',
 'changefreq' => 0,
 'changecount' => -1,
 'status_default' => 0,
 'priority_default' => 0.5,
 ) in /home/motogpod/motopodcast.com/sites/all/modules/xmlsitemap/xmlsitemap.module on line 584.
raghu_gh’s picture

When Ever I update xml Site map I am getting this error.
What is the solutions for this.

user error: Negative changecount value. Please report this to http://drupal.org/node/516928.array ( 'type' => 'node', 'id' => '1383', 'subtype' => 'articles', 'status' => '1', 'status_default' => '1', 'status_override' => 0, 'priority' => '1.0', 'priority_default' => '1.0', 'priority_override' => 0, 'changefreq' => 0, 'changecount' => -1, 'loc' => 'node/1383', 'lastmod' => 0, 'access' => true, 'language' => '', ) in /home/../public_html/sites/all/modules/xmlsitemap/xmlsitemap.module on line 584.

Dave Reid’s picture

Assigned: Dave Reid » Unassigned
Alex Andrascu’s picture

Getting this in 7.x-2.0-rc1

Negative changecount value. Please report this to <a href="http://drupal.org/node/516928">http://drupal.org/node/516928</a>.<br />array (                              [error]
  &#039;type&#039; =&gt; &#039;node&#039;,
  &#039;id&#039; =&gt; &#039;10407&#039;,
  &#039;subtype&#039; =&gt; &#039;story&#039;,
  &#039;status&#039; =&gt; &#039;1&#039;,
  &#039;status_default&#039; =&gt; &#039;1&#039;,
  &#039;status_override&#039; =&gt; 0,
  &#039;priority&#039; =&gt; &#039;0.8&#039;,
  &#039;priority_default&#039; =&gt; &#039;0.8&#039;,
  &#039;priority_override&#039; =&gt; 0,
  &#039;changefreq&#039; =&gt; 0,
  &#039;changecount&#039; =&gt; -1,
  &#039;loc&#039; =&gt; &#039;node/10407&#039;,
  &#039;lastmod&#039; =&gt; 0,
  &#039;access&#039; =&gt; true,
  &#039;language&#039; =&gt; &#039;de&#039;,
) xmlsitemap.module:588
Vacilando’s picture

Title: Negative changecount value error after node creation » Query error after node creation with PostgreSQL
FileSize
29.47 KB

Confirming -- getting the error still in 7.x-2.0-rc1 (and using MySQL, not PostgreSQL).

In our case it happens when several people create nodes of the same type. In one case, 3 people from a group of 5 got this error message.

rp7’s picture

Confirming as well.

Vacilando’s picture

Title: Query error after node creation with PostgreSQL » Negative changecount value error after node creation

Adjusting the title to

  1. make it more descriptive
  2. remove reference to PostgreSQL since the problem occurs on MySQL installations as well
Anonymous’s picture

Title: Query error after node creation with PostgreSQL » Negative changecount value error after node creation
Version: 6.x-2.0-beta3 » 6.x-2.x-dev
Category: support » bug
Status: Active » Needs review
FileSize
802 bytes

Since this is obviously still occuring, here is a patch that will take care of it.

Anonymous’s picture

Issue summary: View changes

Issue summary

Anonymous’s picture

Those of you receiving this error, when the error occurs please determine why the DB returned no rows for db_query("SELECT nr.timestamp FROM {node_revisions} nr WHERE nr.nid = %d", $node->nid);. The patch in 66 only works around that issue.

Vacilando’s picture

What would be the equivalent of #66 for D7 dev? It seems rather different. (I see there is xmlsitemap_recalculate_changefreq() but it is not used anywhere?)

logi’s picture

Assigned: Unassigned » logi

Hello! Here is a problem
user error: Negative changecount value. Please report this to http://drupal.org/node/516928.array ( 'id' => '66', 'type' => 'node', 'subtype' => 'mezhgorod', 'loc' => 'node/66', 'language' => '', 'access' => true, 'status' => '1', 'status_override' => '0', 'lastmod' => 0, 'priority' => '1', 'priority_override' => '0', 'changefreq' => 0, 'changecount' => -1, 'status_default' => '1', 'priority_default' => '1.0', ) in /var/www/vhosts/logitaxi.ru/httpdocs/modules/xmlsitemap/xmlsitemap.module on line 584.

jelo’s picture

My issue (6.x-2.0-rc2):

array ( &#039;type&#039; =&gt; &#039;node&#039;, &#039;id&#039; =&gt; &#039;10421&#039;, &#039;subtype&#039; =&gt; &#039;program&#039;, &#039;status&#039; =&gt; 1, &#039;status_default&#039; =&gt; 1, &#039;status_override&#039; =&gt; 0, &#039;priority&#039; =&gt; &#039;0.9&#039;, &#039;priority_default&#039; =&gt; &#039;0.9&#039;, &#039;priority_override&#039; =&gt; 0, &#039;changefreq&#039; =&gt; 0, &#039;changecount&#039; =&gt; -1, &#039;loc&#039; =&gt; &#039;node/10421&#039;, &#039;lastmod&#039; =&gt; 0, &#039;access&#039; =&gt; false, &#039;language&#039; =&gt; &#039;&#039;, ) in sites/all/modules/xmlsitemap/xmlsitemap.module on line 584

Here is what caused it for me. I was experimenting with a XML import through feeds module into a content type called "program". That content type is setup to be included in the XML sitemap. My XML file included 4 entries for Drupal node IDs that did not exist in the development site (I had accidentally created them in the production site, but not in development). The feed import was configured to use NID as unique identifier and to update existing nodes. However, the XML does not cover a lot of the required fields, just a small subsets of fields in the content type. When I ran the import, feeds stated on screen that 4 new nodes had been created. However, the nodes had in fact not been created, I assume because of missing required field entries. My guess is that feeds fired a hook to notify other modules about the successful creation of a node (when in fact it should not have) which XML sitemap then tried to include. It failed to find entries in the node_revisions because they simply do not exist. When I checked the watchdog, I found 4 error messages like the above for exactly those 4 node IDs in the list.

cha0s’s picture

Got this when running an install profile that installs some content. The weird thing is, I've run it many times and this didn't happen. Only happened the last time, and only on 2 of the 40 or so created noes. Weird. Regardless, here's the full text of the errors:


    User error: Negative changecount value. Please report this to http://drupal.org/node/516928.
    array ( 'type' => 'node', 'id' => '11', 'subtype' => 'msh_page', 'status' => true, 'status_default' => true, 'status_override' => 0, 'priority' => 0.5, 'priority_default' => 0.5, 'priority_override' => 0, 'changefreq' => 0, 'changecount' => -1, 'loc' => 'node/11', 'lastmod' => 0, 'access' => true, 'language' => 'en', ) in xmlsitemap_link_save() (line 588 of /var/www/mckesson_msh/develop/sites/all/modules/contrib/xmlsitemap/xmlsitemap.module).
    User error: Negative changecount value. Please report this to http://drupal.org/node/516928.
    array ( 'type' => 'node', 'id' => '12', 'subtype' => 'msh_page', 'status' => true, 'status_default' => true, 'status_override' => 0, 'priority' => 0.5, 'priority_default' => 0.5, 'priority_override' => 0, 'changefreq' => 0, 'changecount' => -1, 'loc' => 'node/12', 'lastmod' => 0, 'access' => true, 'language' => 'en', ) in xmlsitemap_link_save() (line 588 of /var/www/mckesson_msh/develop/sites/all/modules/contrib/xmlsitemap/xmlsitemap.module).

I'm running 7.x-2.0-rc2

cha0s’s picture

Issue summary: View changes

Issue Summary

super_romeo’s picture

User error: Negative changecount value. Please report this to http://drupal.org/node/516928.
array ( 'type' => 'node', 'id' => '11566', 'subtype' => 'scrap_price', 'status' => 0, 'status_default' => 0, 'status_override' => 0, 'priority' => 0.5, 'priority_default' => 0.5, 'priority_override' => 0, 'changefreq' => 0, 'changecount' => -1, 'loc' => 'node/11566', 'lastmod' => 0, 'access' => true, 'language' => '', ) в функции xmlsitemap_link_save() (строка 588 в файле /DATA/home-sites/sday_lom_rf/htdocs/sites/all/modules/xmlsitemap/xmlsitemap.module).

gaurav.goyal’s picture

Issue summary: View changes
FileSize
38.86 KB

While migrating nodes from drupal 6 to drupal 7, getting this error

MigrateException: Negative changecount value. Please report this to http://drupal.org/node/516928.
array ( 'type' => 'node', 'id' => '7058', 'subtype' => 'news', 'status' => '0', 'status_default' => '0', 'status_override' => 0, 'priority' => '0.5', 'priority_default' => '0.5', 'priority_override' => 0, 'changefreq' => 0, 'changecount' => -1, 'loc' => 'node/7058', 'lastmod' => 0, 'access' => false, 'language' => 'en', ) File /var/www/hcl/docroot/sites/all/modules/contrib/xmlsitemap/xmlsitemap.module, line 588 in MigrationBase->errorHandler() (line 530 of /var/www/hcl/docroot/sites/all/modules/contrib/migrate/includes/base.inc).

Negative changecount value. Please report this to http://drupal.org/node/516928.
array ( 'type' => 'node', 'id' => '7058', 'subtype' => 'news', 'status' => '0', 'status_default' => '0', 'status_override' => 0, 'priority' => '0.5', 'priority_default' => '0.5', 'priority_override' => 0, 'changefreq' => 0, 'changecount' => -1, 'loc' => 'node/7058', 'lastmod' => 0, 'access' => false, 'language' => 'en', ) File /var/www/hcl/docroot/sites/all/modules/contrib/xmlsitemap/xmlsitemap.module, line 588

moehac’s picture

Per the error message, I'm posting the error in this thread. We are running MariaDb 10.0.

array_flip(): Can only flip STRING and INTEGER values! [warning] entity.inc:182 Negative changecount value.

array (
‘type’ => ‘node’,
‘id’ => ‘[nid]’,
‘subtype’ => ‘[node type]’,
‘status’ => 0,
‘status_default’ => 0,
‘status_override’ => 0,
‘priority’ => 0.5,
‘priority_default’ => 0.5,
‘priority_override’ => 0,
‘changefreq’ => 0,
‘changecount’ => -1,
‘loc’ => ‘node/[nid]’,
‘lastmod’ => 0,
‘access’ => false,
‘language’ => ‘und’,
)
xmlsitemap.module:602

Rade’s picture

Reporting per the error message. I was doing a D7 -> D7 migration when this happened:

WD node: MigrateException: Negative changecount value. Please report this to http://drupal.org/node/516928.array ( [error]
'type' => 'node',
'id' => '147402',
'subtype' => 'article',
'status' => '1',
'status_default' => '1',
'status_override' => 0,
'priority' => '0.7',
'priority_default' => '0.7',
'priority_override' => 0,
'changefreq' => 0,
'changecount' => -1,
'loc' => 'node/147402',
'lastmod' => 0,
'access' => true,
'language' => 'und',
)
File /.../modules/contrib/xmlsitemap/xmlsitemap.module, line 602 in MigrationBase->errorHandler() (line 707 of /.../modules/contrib/migrate/includes/base.inc).

gobinathm’s picture

Status: Needs review » Closed (outdated)

As D6 is in EOL, I believe there won't be any support / fix for a problem identified in 6x going forward. Hence i guess this issue can be closed.

Changing the status, if incorrect pls revert the status.

bmunslow’s picture

Version: 6.x-2.x-dev » 7.x-2.3
Status: Closed (outdated) » Needs work

I just got the following message in a Drupal 7 site:

User error: Negative changecount value. Please report this to http://drupal.org/node/516928.
array ( 'status' => '1', 'status_default' => '1', 'status_override' => 0, 'priority' => '0.7', 'priority_default' => '0.7', 'priority_override' => 0, 'type' => 'node', 'id' => '65279', 'subtype' => 'noticia_canal', 'changefreq' => 0, 'changecount' => -1, 'loc' => 'node/65279', 'lastmod' => 0, 'access' => false, 'language' => 'ca', ) in xmlsitemap_link_save() (line 602 de /sites/all/modules/xmlsitemap/xmlsitemap.module).
GoZ’s picture

Status: Needs work » Needs review
FileSize
1.17 KB

Re-roll patch for Drupal 7.x-2.x.

This fix this issue for me.

donaldinou’s picture

This still occurs in xmlsitemap 7.x-2.5

I've just got this message for all my nodes in a certain type.

User error : Negative changecount value. Please report this to https://www.drupal.org/node/516928.
array ( 'type' => 'node', 'id' => '1070', 'subtype' => 'vente', 'status' => '1', 'status_default' => '1', 'status_override' => 0, 'priority' => '0.5', 'priority_default' => '0.5', 'priority_override' => 0, 'changefreq' => 0, 'changecount' => -1, 'loc' => 'node/1070', 'lastmod' => 0, 'access' => 0, 'language' => 'fr', ) dans xmlsitemap_link_save() (ligne 663 dans /var/www/html/drupal/common/sites/all/modules/xmlsitemap/xmlsitemap.module).
Chris Matthews’s picture

Version: 7.x-2.3 » 7.x-2.x-dev
Assigned: logi » Unassigned
Status: Needs review » Needs work
sokru’s picture

Happened today with xmlsitemap 7.x-2.6, could not reproduce it after it first happened. Applied the patch #78.

marco-s’s picture

It happened with xmlsitemap 7.x-2.x-dev too (Drupal 7.65). I have applied the patch #78 today. Keep watching the problem.

loze’s picture

I just got this for the first time today. Error said to post here.
Drupal 7.69
xmlsitemap 7.x-2.6

php:User error: Negative changecount value. Please report this to https://www.drupal.org/node/516928.
array ( 'type' => 'node', 'id' => '90913', 'subtype' => 'photo', 'status' => '0', 'status_default' => '0', 'status_override' => 0, 'priority' => '0.5', 'priority_default' => '0.5', 'priority_override' => 0, 'changefreq' => 0, 'changecount' => -1, 'loc' => 'node/90913', 'lastmod' => 0, 'access' => false, 'language' => 'und', ) in xmlsitemap_link_save() (line 658 of /var/www/html/sites/all/modules/contrib/xmlsitemap/xmlsitemap.module);

This is the first time I've ever seen this error on a site that's been running smoothly for 6+ years

It may be related to memcache as I had been tweaking some settings recently.

Happened on a cron run.

Strange thing is the node referenced in the error node/90913 does not exist in the node table. Unsure of when it was deleted, and if it was intentionally or by error.

Could very well have been deleted by a user as the type 'photo' can be created/deleted by any registered user and happens frequently. But as I said, I've never seen this one before.