CryptoSys Home > FirmaSAT > Troubleshooting

Troubleshooting FirmaSAT


Please make sure you are using the latest version of FirmaSAT. Only the latest version of FirmaSAT is supported. The latest version is latest version number. See also Frequently asked questions.

Known Issues | Old issues now fixed | Frequent troubleshooting questions | Contact us

Known Issues with FirmaSAT

VB6 no longer supported on Windows XP
If you are still running Windows XP and using the VB6 interface to FirmaSAT, it will fail when trying to call some functions like SAT_SignXML or SAT_ValidateXml.
Visual Basic ha detectado un problema y debe cerrarse
(Visual Basic has encountered a problem and needs to close)
This is a problem from version 9.1.20 onwards caused by a fix for multithreading issues which is incompatible with VB6 running on XP.

Despite our best efforts to support old platforms and programming languages, we can no longer support VB6 on Windows XP. See Minimum Requirements. VB6 still works on all later Windows platforms.

Two optional attributes currently mandatory in GastosHidrocarburos10
FirmaSAT will insist that the two "optional" attributes MontoTotalIVA and FechaFolioFiscalVinculado in the element GastosHidrocarburos/Erogacion/DocumentoRelacionado are considered as "required". Until SAT fix the problem with their XSLT file, omitting these attributes will cause an error. See Error in GastosHidrocarburos10.xslt.

Some frequent troubleshooting questions

  1. Why does my XML file not validate? Why does SignXML not work for me?
  2. Why do strange characters like é appear in my output?
  3. Why do I get error code -106 when signing a CFDv3.3 document?
  4. Why do I get a "type's content type is empty" error when validating my signed XML?
  5. Why has my CFDiv3.3 document been signed using SHA-1?
  6. I'm trying to sign a large file, but it's too slow?
  7. How do I fix "Exception from HRESULT:0x8007000B"?
  8. How can I check if my file is in UTF-8?
  9. What is a byte order mark (BOM)?
Why does my XML file not validate? Why does SignXML not work for me?
See Why is my signature not valid?
Why do strange characters like é appear in my output?
All output (except help and error messages) is in UTF-8. On the command-line console or in an old text editor that is not UTF-8-aware, the accented characters (áéíóúñ) will appear as two "funny" characters. For example, "México" will appear as "México". To fix, change the console font and code page, or output to a text file and use a text editor that can cope with UTF-8.
Why do I get error code -106 when signing a CFDv3.3 document?
Because you must complete the NoCertificado with the matching serial number of the certificate being used to sign the document before attempting to sign. This is a requirement for CFD v3.3 documents.
>firmasat signxml -s @ -c pac.cer -k pac.key -p 12345678a -i cfdv33a-base.xml -o aout.xml
STATUS: -106
ERRORDESCRIPTION: Error code -106: Certificate numbers do not match/Los numeros de certificado no coinciden (CERT_NUM_ERROR):
Certificate serial number in XML '30001000000300023708' does not match number
  '30001000000300023699' in X.509 certificate/Numero de serie del certificado
  en XML no coincide con el numero de certificado X.509
Why do I get a "type's content type is empty" error when validating my signed XML?
This error is not caused by FirmaSAT, but by subsequent processing. See "Error: type's content type is empty" when validating XML document signed by FirmaSAT.
Why has my CFDiv3.3 document been signed using SHA-1?
See Why has my CFDiv3.3 document been signed using SHA-1?
I'm trying to sign a large file, but it's too slow?
The default behaviour of FirmaSAT is to load everything into memory before processing. This can be slow for large files, in particular large Contabilidad files. Version 7.0 and above has a "BIGFILE" option that speeds up file processing considerably (just make sure you use different file names for input and output!). See BIGFILE option.
How do I fix "Exception from HRESULT:0x8007000B"?
An attempt was made to load a program with an incorrect format. (Exception from HRESULT:0x8007000B)
See Exception from HRESULT:0x8007000B.
How can I check if my file is in UTF-8?
Use a tool like hexdump.exe to examine your XML document. Accented characters like áéíóñ should be represented by two bytes in the hex dump.

Here is an extract from an XML document:

pais="México" formaDePago="Una sola exhibición"

Use the command-line instruction

hexdump -C myfile.xml

If your file is in UTF-8 encoding, the accented characters will show as two bytes.

000000  70 61 69 73 3d 22 4d c3 a9 78 69 63 6f 22 20 66  pais="M..xico" f
000010  6f 72 6d 61 44 65 50 61 67 6f 3d 22 55 6e 61 20  ormaDePago="Una
000020  73 6f 6c 61 20 65 78 68 69 62 69 63 69 c3 b3 6e  sola exhibici..n
000030  22                                               "
But if it's in Latin-1 (ISO-8859-1), the accented characters will only show as single byte values.
000000  70 61 69 73 3d 22 4d e9 78 69 63 6f 22 20 66 6f  pais="M.xico" fo
000010  72 6d 61 44 65 50 61 67 6f 3d 22 55 6e 61 20 73  rmaDePago="Una s
000020  6f 6c 61 20 65 78 68 69 62 69 63 69 f3 6e 22     ola exhibici.n"
In this case, you must re-save the file in UTF-8.

You could also use the CNV_CheckUTF8Bytes function or Cnv.CheckUTF8 Method in CryptoSys PKI, reading the file into a byte array first. If the result is zero it means your file is not valid UTF-8.

What is a byte order mark (BOM)?
A byte-order mark for UTF-8 is the sequence of three bytes (0xEF,0xBB,0xBF) at the beginning of a file.

Although it is actually unnecessary to use a BOM for a UTF-8-encoded file, some validation sites will require it in all XML documents and will give an error if it is not present. For more on this see UTF-8 byte-order mark problem. We have added a new function in FirmaSAT 4.1 to fix it.

You cannot detect the presence of a BOM using a modern text editor like NotePad or UltraEdit because they look for it and act on it but do not show it (because it actually represents a zero-width, no-break character in Unicode). Older editors may show it as .

You can use a tool like hexdump.exe to examine your XML document or use a hex editor like HxD Free Hex Editor. The output should look like this:

hexdump -C miarchivo.xml
000000  ef bb bf 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e  ...<?xml version
000010  3d 22 31 2e 30 22 20 65 6e 63 6f 64 69 6e 67 3d  ="1.0" encoding=
000020  22 55 54 46 2d 38 22 3f 3e 0d 0a 3c 43 6f 6d 70  "UTF-8"?>..<Comp
000030  72 6f 62 61 6e 74 65 20 78 6d 6c 6e 73 3d 22 68  robante xmlns="h
000040  74 74 70 3a 2f 2f 77 77 77 2e 73 61 74 2e 67 6f  ttp://www.sat.go

If you see ef bb bf at the beginning then the file has the required BOM.

Contact us

To comment on this page or ask a question, please Send us a message. For support, go to the support page.

This page last updated 14 December 2022