benoitc / benoitc/erica

Attaching filenames with parentheses cause ERROR

Open
#59 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
264
Forks
30
PR merge metrics
No merged PRs in 30d

Description

When pushing docs with attached files, and filename of the attachment has parentheses '(' or ')', erica throws the following error.

Command:

``` cli
erica.cmd push http://@localhost:5984/
```

Error:

``` erlang
ERROR: push failed while processing C:/: {'EXIT',{{badmatch,{error,enoent}},
[{erica_push,attachments_from_fs1,4,
[{file,"src/erica_push.erl"},{line,490}]},
{erica_push,attachments_from_fs,1,
[{file,"src/erica_push.erl"},{line,473}]},
{erica_push,couchapp_from_fs,1,
[{file,"src/erica_push.erl"},{line,195}]},
{erica_push,do_push,4,[{file,"src/erica_push.erl"},{line,81}]},
{erica_push,push2,3,[{file,"src/erica_push.erl"},{line,52}]},
{erica_push,push1,3,[{file,"src/erica_push.erl"},{line,43}]},
{erica_core,run_modules,4,[{file,"src/erica_core.erl"},{line,97}]},
{erica_core,execute,4,[{file,"src/erica_core.erl"},{line,67}]}]}}
```

A look at the Erlang docs make me think that this error is probably due do the filename being attached (I focused on the 'enoent' part of the error, and that's what I found). The filename doesn't show up in the file path (the above is just the working directory).

Changing the filename of the attached file to remove the parentheses fixed the problem.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with src/erica_push.erl at attachments_from_fs/1 around line 473 and attachments_from_fs1/4 around line 490. Reproduce the failure by running erica.cmd push with an attached filename containing parentheses, then verify that the push succeeds with that filename and no enoent error.

Written by the indexing model from the issue text.

Assessment

Tech stack
erlang
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.