timofurrer / pandoc-mermaid-filter

Pandoc filter for mermaid code blocks
MIT License
78 stars 22 forks source link

PermissionError: [Errno 13] Permission denied #1

Closed RidaAyed closed 6 years ago

RidaAyed commented 6 years ago

Hi $ pandoc example.md -o example.pdf --filter pandoc-mermaid

returns

Traceback (most recent call last):
  File "/usr/bin/pandoc-mermaid", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python3.6/site-packages/pandoc_mermaid_filter.py", line 39, in main
    toJSONFilter(mermaid)
  File "/usr/lib/python3.6/site-packages/pandocfilters.py", line 132, in toJSONFilter
    toJSONFilters([action])
  File "/usr/lib/python3.6/site-packages/pandocfilters.py", line 166, in toJSONFilters
    sys.stdout.write(applyJSONFilters(actions, source, format))
  File "/usr/lib/python3.6/site-packages/pandocfilters.py", line 197, in applyJSONFilters
    altered = walk(altered, action, format, meta)
  File "/usr/lib/python3.6/site-packages/pandocfilters.py", line 124, in walk
    x[k] = walk(x[k], action, format, meta)
  File "/usr/lib/python3.6/site-packages/pandocfilters.py", line 111, in walk
    item['c'] if 'c' in item else None, format, meta)
  File "/usr/lib/python3.6/site-packages/pandoc_mermaid_filter.py", line 29, in mermaid
    with open(src, "wb") as f:
PermissionError: [Errno 13] Permission denied: 'mermaid-images/44ded099cf2f17c594abfaa9fbedb52caca93eb0.mmd'
Error running filter pandoc-mermaid:
Filter returned error status 1

I've installed mermaid.cli locally:
$ npm install mermaid.cli

furthermore I replaced ln MERMAID_BIN with: MERMAID_BIN = '/home/ra/node_modules/.bin/mmdc'

Any ideas what I've missed?

timofurrer commented 6 years ago

It seems like you don't have write permissions to mermaid-images/. Can you check that?

On Mon, Jun 4, 2018 at 11:40 AM Rida Ayed notifications@github.com wrote:

Hi $ pandoc example.md -o example.pdf --filter pandoc-mermaid

returns

Traceback (most recent call last): File "/usr/bin/pandoc-mermaid", line 11, in sys.exit(main()) File "/usr/lib/python3.6/site-packages/pandoc_mermaid_filter.py", line 39, in main toJSONFilter(mermaid) File "/usr/lib/python3.6/site-packages/pandocfilters.py", line 132, in toJSONFilter toJSONFilters([action]) File "/usr/lib/python3.6/site-packages/pandocfilters.py", line 166, in toJSONFilters sys.stdout.write(applyJSONFilters(actions, source, format)) File "/usr/lib/python3.6/site-packages/pandocfilters.py", line 197, in applyJSONFilters altered = walk(altered, action, format, meta) File "/usr/lib/python3.6/site-packages/pandocfilters.py", line 124, in walk x[k] = walk(x[k], action, format, meta) File "/usr/lib/python3.6/site-packages/pandocfilters.py", line 111, in walk item['c'] if 'c' in item else None, format, meta) File "/usr/lib/python3.6/site-packages/pandoc_mermaid_filter.py", line 29, in mermaid with open(src, "wb") as f: PermissionError: [Errno 13] Permission denied: 'mermaid-images/44ded099cf2f17c594abfaa9fbedb52caca93eb0.mmd' Error running filter pandoc-mermaid: Filter returned error status 1

I've installed mermaid.cli locally: $ npm install mermaid.cli

furthermore I replaced ln MERMAID_BIN with: MERMAID_BIN = '/home/ra/node_modules/.bin/mmdc'

Any ideas what I've missed?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/timofurrer/pandoc-mermaid-filter/issues/1, or mute the thread https://github.com/notifications/unsubscribe-auth/AA9ifB81c_9miRmpyoHhDeczO7-BK19Uks5t5QCIgaJpZM4UYw79 .

-- Timo Furrer

https://github.com/timofurrer tuxtimo@gmail.com

RidaAyed commented 6 years ago

Thanks Timo :+1: . Deleting the folder solved the permission error. Alas it leads to another error

[0604/133802.155880:FATAL:zygote_host_impl_linux.cc(126)] No usable sandbox! Update your kernel or see..

Since it seems mermaid cli related I've posted the issue here: https://github.com/mermaidjs/mermaid.cli/issues/39