Snowfakery icon indicating copy to clipboard operation
Snowfakery copied to clipboard

Windows 237 NotADirectory Error with Salesforce Query

Open allisonletts opened this issue 2 years ago • 2 comments

I'm running Windows with VSCode-based Powershell and snowfakery 3.5. When I try to run a snowfakery recipe that queries Salesforce records, I receive an error message.

This appears to be the crux of the issue: NotADirectoryError: [WinError 267] The directory name is invalid: 'C:\\Users\\ALLISO~1\\AppData\\Local\\Temp\\tmp9b9uku52\\queryresults.db'

Full documentation: https://gist.github.com/allisonletts/994828955eb9c266936f73b4d9e52b4b

allisonletts avatar May 17 '23 20:05 allisonletts

I'm still having the same issue: https://gist.github.com/allisonletts/0e575f28e49834d676c0571dcd3b88c0

allisonletts avatar Oct 31 '23 20:10 allisonletts

This continues to be an issue on Windows 11.

acrosman avatar Mar 27 '24 16:03 acrosman

@acrosman have you attempted on a mac? I haven't, but could.

allisonletts avatar Apr 02 '24 15:04 allisonletts

@allisonletts This code is trying to clean up a temporary directory after the code runs. It claims in the link you provided that the Exception is ignored (line 13 and line 38).

Is that your observation? Does the process work except for an annoying traceback?

It looks like it to me.

It's annoying but at least it shouldn't block your work until it's fixed.

Let me know if it is actually blocking your work.

prescod avatar Apr 02 '24 16:04 prescod

When I ran into it the other day I'm reasonably confident it stopped cold. I ended up re-writing the recipe to avoid the - plugin: snowfakery.standard_plugins.Salesforce.SOQLDataset entirely, so it'll need to try to assembly a minimal example when I have a few minutes. I did not test it on my mac, but I can do that as well when I have a new sample.

acrosman avatar Apr 02 '24 16:04 acrosman

Yeah, I also had it stop, I'm pretty sure.

allisonletts avatar Apr 02 '24 16:04 allisonletts

I've been experimenting with recipes tonight trying to find one that actually blocks the run, and reproduces the errors.

What I've managed to do so far is get recipes that will produce the error, but support @prescod's assertion that it does not block completion. It also seems to only occur in recipes that have multiple queries. Any other error in the recipe will block completion of the inserts, but the ones I created were all unrelated (a few looked like they were).

The error only appears on Windows, not Mac. Requires two or more queries. The error message does not appear to block completion (that I can find so far).

- plugin: snowfakery.standard_plugins.Salesforce.SOQLDataset
- object: Contact
  count: 10
  fields:
    __users_from_salesforce:
      SOQLDataset.shuffle:
        fields: Id, FirstName, LastName
        from: User
    __Account_from_Salesforce:
      SOQLDataset.shuffle:
        fields: Id
        from: Account
    # The next line depends on the users having particular
    # permissions.
    FirstName: ${{__users_from_salesforce.FirstName}}
    LastName: ${{__users_from_salesforce.LastName}}
    AccountId: ${{__Account_from_Salesforce.Id}}

acrosman avatar Apr 03 '24 01:04 acrosman