Extract Date error do_extract_account_registers() has failed

hassettp's Avatar

hassettp

05 Sep, 2024 01:45 PM

Hi
I'm using Extract Data v1044, Moneydance v2024.1 on MacOS Sonoma 14.6.1.

I've been running Extract Data -
Screen 1 - Account register transactions - extract to CSV.
Screen 2 - All accounts and a date range of one month
Screen shots are attached to show the options used.

Today, when I ran Extract Data for the date range 1-30Apr24. I received the error message
">>>
--------------------------------
EXTRACT DATA: MESSAGES & SUMMARY

SINGLE DATA FILE EXTRACT MODE ENABLED

Extract Account Registers REQUESTED

EXTRACT: Account Registers: @@ ERROR: do_extract_account_registers() has failed (review console)!

Extract csv files / folders created..: 0
Extract errors during extract........: 1

*** EXTRACT FAILED WITH ERROR >> REVIEW CONSOLE FOR DETAILS ***
I have rerun Extract Data for the same date range for each account and I have identified an account where this error occurs.

I assume that there is some corrupt data on this account???

Please let me know how to rectify this issue.

Peter

  1. 1 Posted by sth on 06 Sep, 2024 01:07 AM

    sth's Avatar

    So open the Console Log (ie Help->Console Window). Run MD. Do your data extraction. Then copy the whole window to at text file and post it. (remove any sensitive data in the file).

    NOTE: the "Extract Data Extension" is not provided by IK as part of MD. The good news is that the author, Stuart, is quite active on this forum and may be able to help you.

    (NOT IK Support)

  2. 2 Posted by dtd on 06 Sep, 2024 01:59 AM

    dtd's Avatar

    Stuart is gone for a month, on vacation, so it may be longer than normal.
    But it is hard for Stuart to stay away.

  3. 3 Posted by hassettp on 06 Sep, 2024 05:20 AM

    hassettp's Avatar

    Log file attached

  4. 4 Posted by Stuart Beesley ... on 06 Sep, 2024 06:35 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    That’s a new one. This is the error:

    ValueError: year=1359 is before 1900; the datetime strftime() methods require year >= 1900
    

    So. Do you have a transaction with a very old / silly date? Please check your register and confirm? Thanks.

  5. 5 Posted by hassettp on 06 Sep, 2024 08:44 AM

    hassettp's Avatar

    Hi
    Thank you for the quick response.
    I've looked through the registers and cannot find a silly date.

    I have run Extract data using the Extract raw data to JSON file.There are over 100 hits on 1359 e.g. "dtentered": "1722621135994",

    Any suggestions on how to find the transaction would be appreciated.

    Extract Data on all accounts using a date range of first to last date of same month errors for April and May 2024, but runs successfully for all other months before and after April and May 2024.

    Thank you

  6. 6 Posted by Stuart Beesley ... on 06 Sep, 2024 09:16 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Temporary fix.. Use this updated build (1045) attached... It will run, extract all the data (as normal), print a message in console, and the bad date will show in the extract file / column as "??date??"..

    Download the zip, unzip.. Make sure the resulting file is extract_data.mxt
    Then MD menu, extensions, install from file, select this file..

    Let me know?

  7. 7 Posted by Stuart Beesley ... on 06 Sep, 2024 09:37 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    or grab from my site - the latest PREVIEW (SIGNED) versions.. Same code as attached above..

    https://yogi1967.github.io/MoneydancePythonScripts/

  8. 8 Posted by Stuart Beesley ... on 06 Sep, 2024 10:02 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    FYI - the format within the json file will start with 1359 and be followed with mmdd eg 13590101. Given your date range I suspect one of the other date fields.

    DATE
    TAXDATE
    DATE_ENTERED
    SYNC_DATE
    RECONCILED_DATE
    RECONCILED_ASOF

    My guess is tax date? Do you have these turned on?

    Failing that a dodgy system hidden date field…

    Anyway, let me know?

    Thanks.

  9. 9 Posted by hassettp on 06 Sep, 2024 10:40 AM

    hassettp's Avatar

    Hello Stuart
    Build 1045 ran fine

    No errors were reported
    >>>
    --------------------------------
    EXTRACT DATA: MESSAGES & SUMMARY

    SINGLE DATA FILE EXTRACT MODE ENABLED

    Extract Account Registers REQUESTED

    EXTRACT: Account Registers: CSV file: '/Users/Peter/Downloads/Personal Finances_2023-09-01_extract_account_registers_20240906_113333.csv' created (145 records)

    Extract csv files / folders created..: 1
    Extract errors during extract........: 0

    And there is no ??date?? string in the csv file or the Console Messages file.

    The TaxDate field is blank in the csv file.

    Many thanks for your help, much appreciated.

    Peter

  10. 10 Posted by Stuart Beesley ... on 06 Sep, 2024 10:44 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Humour me. Can you grab help/console output for the section where the report ran and upload that here?

  11. 11 Posted by hassettp on 06 Sep, 2024 10:47 AM

    hassettp's Avatar

    File attached

  12. 12 Posted by Stuart Beesley ... on 06 Sep, 2024 10:57 AM

    Stuart Beesley (Mr Toolbox)'s Avatar
    EXTRACT: Account Registers:       Account Register Transaction Records (Parents, Splits, Attachments) selected: 145
    extract_data.py(Extension):2024/09/06-11:33:33: ALERT: INVALID DATE < 19000101 - found '13590501'
    extract_data.py(Extension):2024/09/06-11:33:33: ALERT: INVALID DATE < 19000101 - found '13590501'
    extract_data.py(Extension):2024/09/06-11:33:33: ALERT: INVALID DATE < 19000101 - found '13590501'
    extract_data.py(Extension):2024/09/06-11:33:33: ALERT: INVALID DATE < 19000101 - found '13590501'
    extract_data.py(Extension):2024/09/06-11:33:33: ALERT: INVALID DATE < 19000101 - found '13590501'
    extract_data.py(Extension):2024/09/06-11:33:33: ALERT: INVALID DATE < 19000101 - found '13590501'
    extract_data.py(Extension):2024/09/06-11:33:33: ALERT: INVALID DATE < 19000101 - found '13590501'
    extract_data.py(Extension):2024/09/06-11:33:33: ALERT: INVALID DATE < 19000101 - found '13590501'
    extract_data.py(Extension):2024/09/06-11:33:33: ALERT: INVALID DATE < 19000101 - found '13590501'
    extract_data.py(Extension):2024/09/06-11:33:33: ALERT: INVALID DATE < 19000101 - found '13590501'
    extract_data.py(Extension):2024/09/06-11:33:33: EXTRACT: Account Registers:       Opening file and writing 145 records
    extract_data.py(Extension):2024/09/06-11:33:33: EXTRACT: Account Registers:       CSV file: '/Users/Peter/Downloads/Personal Finances_2023-09-01_extract_account_registers_20240906_113333.csv' created (145 records)
    extract_data.py(Extension):2024/09/06-11:33:33: EXTRACT: Account Registers:       Extract file CREATED:
    With 145 rows and 0 attachments downloaded
    

    Somewhere you have this date:
    ‘13590501’ ie - 01/05/1359 or 05/01/1359

    try your JSON search again for 13590501

    Or the csv should contain

    ??13590501??
    
  13. 13 Posted by Stuart Beesley ... on 06 Sep, 2024 11:00 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Try narrowing the date down by cutting the range in half.

    Eg
    20240401 to 20240415
    20240401 to 20240407

    Adjusting the range to fit around the dates that show the error in console. It should only take about 4 goes to find the exact date.

  14. 14 Posted by hassettp on 06 Sep, 2024 11:55 AM

    hassettp's Avatar

    I misunderstood your earlier email. I was looking for the literal string "??date??"

    I've found the transactions in the JSON file. One example:
          "dtentered": "1712206215416",
          "acctid": "8ea0f194-4769-4bfb-acf0-2dd124329028",
          "memo": "",
          "0.id": "690c2162-5a24-4683-9a01-3764497cb7aa",
          "dt": "20240412",
          "0.desc": "BBOWT - MEMBERSHIP",
          "0.acctid": "ff504a5b-eee8-48bb-bf8c-a1ee58ae0212",
          "0.samt": "450",
          "rec_dt": "1717126920108",
          "obj_type": "txn",
          "id": "d8425940-c8db-4db1-a4d8-bc4d099af36f.20240414",
          "stat": "X",
          "chk": "Trn",
          "0.obj_type": "",
          "rec_asof": "13590501",
          "td": "20240412",
          "0.pamt": "-450",
          "0.stat": " ",
          "desc": "BBOWT - MEMBERSHIP",
          "ts": "1717126920110"

    I assume I had fat finger trouble when I was reconciling the account.

    I also assume that I can't correct the data, but, with your new version of the Extract Date extension, I have been able to extract the data I need.

    Many thanks for your help

    Peter

  15. 15 Posted by Stuart Beesley ... on 06 Sep, 2024 12:35 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Yes, in the csv file it will be "??13590501??", but in the JSON it will be just '13590501'..

    So you have an odd, system generated reconciled asof date
    "rec_asof": "13590501"

    Do you use online banking on this account, or perhaps import OFX files..? If you reconcile the account, does the popup show this date? What happens if you download a new OFX and try all this again..?

  16. 16 Posted by hassettp on 06 Sep, 2024 01:26 PM

    hassettp's Avatar

    Hi
    I downloaded the transactions for April 2024 as a QIF file for the account with the invalid dates.

    After merging the transactions, I reconciled the account to today's date.

    This hasn't changed the reconciliation dates in the csv file.

    I'm happy to live with the invalid reconciliation dates. The only problems I have encountered is when extracting data using your extension. And with build 1045 that you kindly provided, this problem has gone away.

    Best wishes

    Peter

  17. 17 Posted by Stuart Beesley ... on 06 Sep, 2024 01:46 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    👍 (It’s very odd. Obviously a gremlin in MD somewhere, or a memory issue. Or something caused that date to be set)

  18. 18 Posted by hassettp on 07 Sep, 2024 08:43 AM

    hassettp's Avatar

    Hi
    I've run a few tests

    It looks as though MD doesn't check that a valid year is entered when you reconcile the account. It will accept years such as 1066.

    If you put in an invalid date (day and month combination) e.g. 31 April, MD doesn't display an error, it moves the date to the next valid date. in this instance 1 May.

    Will the change you made in build 1045 be carried forward into subsequent versions of Extract Data?

    I think that if the invalid dates became a problem for me, I could delete the entries and re-enter them.

    Thank you for all you help

    Peter

  19. 19 Posted by Stuart Beesley ... on 07 Sep, 2024 10:00 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Yup. I’m fact I updated the build. Get the latest from here.
    https://yogi1967.github.io/MoneydancePythonScripts/

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • MD1.jpg 248 KB
  • MD2.jpg 357 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac