New document becomes ID 0

One of my projects changed server in end of may, but still not published. At first the new installation looks alright. But now after some weeks with no working on it, I find a large problem:

Every time I create a new document it becomes the ID 0. This document can not be edit. The only way to delete it is directly in the database.

This new document has also automatically the resourcetree, which is in the web-context, like a new context or a duplicate.

If I create a new element like a chunk, it is alright, it becomes a new ID.

I cleared the cache, I run setup. No solution.
Error-Log
[2019-09-15 19:13:18] (ERROR @ /…/httpdocs/username/core/model/modx/modx.class.php : 1031) 0 is not a valid integer and may not be passed to makeUrl()

Maybe a new installation could help, but I already have some changings since the installation.

Or could it be the configuration of the server?

What happens?

Das Projekt wurde Ende Mai schon auf einen neuen Server gelegt, aber noch nicht veröffentlicht.

Die Seite schien zunächst korrekt zu laufen. Nach einigen Wochen Arbeitspause fällt aber jetzt ein schwerwiegender Fehler auf:

Wenn ein neues Dokument erstellt wird, bekommt es immer die ID 0, es ist danach nicht weiter bearbeitbar und kann nicht gefunden werden. Das Dokumet kann nur in der Datenbank direkt wieder gelöscht werden.

Unter diesem Dokument wird automatisch der Resourcenbaum erstellt, wie er im web-kontext vorhanden ist. Als wäre es ein neuer Kontext oder ein Duplikat.

Wenn ich ein neues Element erstelle ist alles richtig, es wird eine neue ID vergeben.

Der Cache wurde mehrfach geleert, Setup durchgefĂĽhrt. Das Problem besteht weiterhin.
Fehlerprotokoll von Modx:
[2019-09-15 19:13:18] (ERROR @ /…/httpdocs/username/core/model/modx/modx.class.php : 1031) 0 is not a valid integer and may not be passed to makeUrl()

Eine Neuinstallation könnte vielleicht helfen, aber ich habe bereits einige Änderungen seit der Installation vorgenommen.
Oder liegt es vielleicht an den Servereinstellungen?
Was kann die Ursache sein?

Modx 2.7.1
PHP 7.3.9
Mysql 5.5.60

1 Like

Two thoughts:

  1. Check the modx_site_content table in the DB. Click on the structure link and make sure the ID field is set to AUTO_INCREMENT with a default value of None.

  2. See if you have any plugins connected to OnDocFormSave or OnBeforeDocFormSave that might be messing with the ID. (Look on the System Events tab when editing the plugin.)

I don’t think it’s likely that it’s a server issue.

Yeah my first thought is also an auto-increment issue on that table.

Thank you for the fast reply.
Really AUTO_INCREMENT was not enabled.
Now it is fixed.

I’m glad you got it sorted, but I can’t think of a reasonable way that could have happened short of someone directly altering that table with a query. Have you been experimenting with “ALTER TABLE” queries by any chance?

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.