Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENAMETOOLONG error thrown when converting big files #1

Closed
Graloth opened this issue Apr 7, 2017 · 5 comments
Closed

ENAMETOOLONG error thrown when converting big files #1

Graloth opened this issue Apr 7, 2017 · 5 comments
Assignees
Labels

Comments

@Graloth
Copy link

Graloth commented Apr 7, 2017

Decided to give the extension a try, but it seems to only want to generate HTML files.

This is the error I get when I try to convert it to PDF or PNG:

Error: spawnSync C:\Users\*private*\.vscode\extensions\manuth.markdown-converter-0.0.6\node_modules\phantomjs-prebuilt\lib\phantom\bin\phantomjs.exe ENAMETOOLONG

I have tried with file names as short as 3 letters, standard, no special characters, no spaces, etc. nothing works.

Like I mentioned, it works 100% with conversion to HTML.

No idea why this is happening, so I'm making an issue with it here, in case it's something that needs attention.

@manuth
Copy link
Owner

manuth commented Apr 7, 2017

Hi there
I just gave it another try with the currently published version (0.0.6) and sadly I couldn't reproduce the error.
Can you please answer me some questions in order to help me finding the source of the problem?

The error you described actually only occurs when the file (phantomjs.exe or the destination-path in this case) is located in a too deep nested folder.

  • Is the *private*-part a deep nested folder-structure?
  • Is your destination-path (either the one you setted in the config (markdownConverter.OutDir) or the folder which contains the markdown-file) an extremely deep nested one?
  • Are you using the most recent version? (0.0.2 or higher)

Thanks for your feedback

~manuth

@manuth manuth self-assigned this Apr 13, 2017
@manuth
Copy link
Owner

manuth commented Apr 26, 2017

Please reopen the issue if you have futher troubles.
I'll close the issue. I guess you could solve it yourself since you didn't answer anymore.

@manuth manuth closed this as completed Apr 26, 2017
@Graloth
Copy link
Author

Graloth commented May 3, 2017

@manuth
Sorry for the very late reply, hadn't had the time to check out your answer.
I am currently using version 0.0.7, and still get the error.

Here are the answers for your questions:

  • The *private*-part is just my account name, so just a single folder.
  • The destination is in C:\Projects\Personal\markdown-debugging, so shouldn't be too deeply nested.
  • Yes, version 0.0.7 as of writing this.

The install path of phantomjs.exe does seem very deeply nested, since it mentions the path in the error, but I have no control over that, as it is where the extension is installed.

Any chance you can add a config option for a custom path to the phantomjs library? It should solve the issue if I just install phantomjs to the local project and then point the config option to that location, as the path then shouldn't be that deeply nested.

I can't reopen this issue.

@manuth manuth reopened this May 4, 2017
@manuth
Copy link
Owner

manuth commented May 9, 2017

Hello Graloth

I could reproduce the error. Looks like it occurs when the file has a certain size.
I'll try to fix this somehow - thanks for notifing me about that!

~Manu

@manuth manuth changed the title ENAMETOOLONG error thrown on convertion ENAMETOOLONG error thrown when converting big files May 9, 2017
@manuth manuth added the bug label May 9, 2017
@manuth
Copy link
Owner

manuth commented May 9, 2017

I finally could find the source of the problem!
It's because of Windows' argument size limitations.
I'm passing a JSON-string that represents the whole document (and its settings) as a console argument which causes the error.

I could fix the issue, so this improvement will be available in version 0.0.8

@manuth manuth closed this as completed May 9, 2017
manuth added a commit that referenced this issue May 9, 2017
This commit fixes #1.
Passing the whole document and its settings as a JSON-string as a console-argument caused an ENAMETOOLONG-error.
The JSON-string is now saved to a file and its path is passed to PhantomJS
manuth added a commit that referenced this issue Jan 15, 2019
This commit fixes #1.
Passing the whole document and its settings as a JSON-string as a console-argument caused an ENAMETOOLONG-error.
The JSON-string is now saved to a file and its path is passed to PhantomJS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants