Skip to main content
VeriFactu

VeriFactu chaining errors: the previous record, the hashes and their lengths

Every VERI*FACTU record carries a reference to the previous one: its number, its date and its hash. That way the chain cannot be broken without it showing. The AEAT, the Spanish tax agency, checks that this reference is well formed, and it has seventeen codes for it: some reject the record and three accept it with a warning.

FlexigoTech · Editor in charge: Víctor Gómez · Updated 4 November 2026

Key facts

Module
VeriFactu
Versions
Odoo 17, 18, 19 and 20
Checked
in the module's source code, version 20.0 · against the sources linked at the end
Reading time
4 min

What the Encadenamiento block carries

The first record
It carries PrimerRegistro set to S and nothing else. If the AEAT already had records of yours with the same software, it answers with 2007, which has its own page.
Every other record
It carries RegistroAnterior: the issuer's tax ID, the number and date of the previous invoice, and its hash.

The hash is a SHA-256 written in hexadecimal and in capitals, 64 characters long. The previous record's hash has to follow that format; if not, the AEAT returns a warning without rejection.

Card for the VeriFactu chaining codes
Seventeen chaining codes: fourteen reject the record and three, in blue, accept it with a warning.

The ones that accept the record

CodeAEAT text
2002La longitud de huella del registro anterior no cumple con las especificaciones.
2003El contenido de la huella del registro anterior no cumple con las especificaciones.
2008El valor de la huella del registro anterior debe ser diferente a la huella del registro actual.

In English: the length, or the content, of the previous record's hash does not follow the specification, and the previous hash must differ from the current one. With these three the invoice stays registered, and in Odoo it shows as «Aceptado con errores (subsanar)», accepted with errors to be corrected.

The ones that reject it

  • Data of the previous record: 1174 for its date, 1175 for its number and 1269 for a badly filled RegistroAnterior.
  • Blocks: 1180 is the generic chaining error and 1274 a wrong value in PrimerRegistro.
  • Hashes: 1291 and 1292 when the hash, previous or current, is not alphanumeric; 1247 for a wrong hash type.
  • Lengths: 1262 for the hash, 1263 for the hash type, 1264 for the first record field, 1265 for the invoice type, 1266 for the total tax and 1267 for the total amount.

How Odoo chains

The module chains each record when the invoice is posted, in order and with a consecutive record number per company. For the Encadenamiento block it looks up the record with the number right before, whether a registration or a cancellation, and copies its tax ID, number, date and hash. If it cannot find it, it sends nothing and stops with «Record … is chained to a previous record that does not exist.».

The hash and the previous hash are stored at chaining time and cannot be changed afterwards. The queue sends each company's records in chain order, and every day the Verifactu: Nightly Integrity Check cron walks the whole chain to confirm it is still intact.

Hash chain status in Odoo
The chain record of a company: integrity, last check, last hash and the record it started from. Odoo 20 screenshot with demo data.

What to do with one of these codes

  1. Open Compliance Records › Chain State and click Verify Integrity. If the local chain is broken, stop invoicing from that company and write to us.
  2. If the local chain is fine, the problem lies in how it reached the AEAT. Keep the submission's answer, the Raw Response field of the queue.
  3. Write to comercial@flexigobe.com with both. Chained records are not touched by hand: they are neither deleted nor edited.

The codes on this page, with the AEAT's text

Each code with its literal text, in Spanish, as the AEAT's error list gives it:

CodeAEAT text (Spanish)
1174El valor del campo FechaExpedicionFactura del bloque RegistroAnteriores incorrecto.
1175El valor del campo NumSerieFactura del bloque RegistroAnterior es incorrecto.
1180Error en el bloque de Encadenamiento.
1247El valor del campo TipoHuella es incorrecto.
1262La longitud de huella no cumple con las especificaciones.
1263La longitud del tipo de huella no cumple con las especificaciones.
1264La longitud del campo primer Registro no cumple con las especificaciones.
1265La longitud del campo tipo factura no cumple con las especificaciones.
1266La longitud del campo cuota total no cumple con las especificaciones.
1267La longitud del campo importe total no cumple con las especificaciones.
1269El bloque Registro Anterior no esta informado correctamente.
1274Valor incorrecto campo primer registro
1291El HASH del Registro anterior no es alfanumérico.
1292El HASH no es alfanumérico.
2002La longitud de huella del registro anterior no cumple con las especificaciones.
2003El contenido de la huella del registro anterior no cumple con las especificaciones.
2008El valor de la huella del registro anterior debe ser diferente a la huella del registro actual.

Keep reading

VeriFactu error 2000: the AEAT recalculates your hash and it does not matchVeriFactu error 2000: the Spanish tax agency recalculates the SHA-256 hash and gets a different one. Why the invoice is registered anyway and what to do in Odoo 17 to 20.VeriFactu error 2007: the AEAT already had your invoices and receives another «first record»VeriFactu error 2007: the AEAT already has invoices from your tax ID made with the same system and gets another first record. Why, in Odoo 17 to 20.VeriFactu errors on the invoicing software: who made the program you invoice withVeriFactu errors in the SistemaInformatico block (1176, 1177, 1179, 1212, 1213, 1220 to 1223, 1226, 1241, 1242): what the AEAT asks and what software data Odoo sends.
Checked in the module's source code (version 20.0) and the linked sources

Sources