[GitHub] couchdb-couch-mrview issue #58: Retry failures in couch_mrview_compactor:rec...

2016-10-07 Thread davisp
Github user davisp commented on the issue:

https://github.com/apache/couchdb-couch-mrview/pull/58
  
Already see a bug, The $gen_cast message needs to use a different variable 
name which it passes to recompact_loop so that we don't get a bad match.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch-mrview issue #58: Retry failures in couch_mrview_compactor:rec...

2016-10-07 Thread davisp
Github user davisp commented on the issue:

https://github.com/apache/couchdb-couch-mrview/pull/58
  
That's the general idea, though there was a bit I wanted to add using the 
update/3 so that we know if the updater is making progress between failures. I 
typed up a quick thing but haven't tried compiling it or anything crazy like 
that.

```diff
diff --git a/src/couch_mrview_compactor.erl b/src/couch_mrview_compactor.erl
index 9dba094..3271103 100644
--- a/src/couch_mrview_compactor.erl
+++ b/src/couch_mrview_compactor.erl
@@ -148,14 +148,31 @@ compact(State) ->
 
 
 recompact(State) ->
+recompact(State, recompact_retry_count()).
+
+recompact(State, 0) ->
+erlang:error(exceeded_recompact_retry_count);
+
+recompact(State, RetryCount) ->
+Self = self(),
 link(State#mrst.fd),
 {Pid, Ref} = erlang:spawn_monitor(fun() ->
-couch_index_updater:update(couch_mrview_index, State)
+couch_index_updater:update(Self, couch_mrview_index, State)
 end),
+recompact_loop(State, RetryCount).
+
+recompact_loop(State, RetryCount) ->
 receive
+{'$gen_cast', {new_state, State}} ->
+% We've made progress so reset RetryCount
+recompact_loop(State, recompact_retry_count());
 {'DOWN', Ref, _, _, {updated, Pid, State2}} ->
 unlink(State#mrst.fd),
-{ok, State2}
+{ok, State2};
+{'DOWN', Ref, _, _, Reason} ->
+unlink(State#mrst.fd),
+couch_log:warning("Error durring recompaction: ~r", [Reason]),
+recompact(State, RetryCount - 1)
 end.
 
 compact_log(LogBtree, BufferSize, Acc0) ->
@@ -265,3 +282,11 @@ swap_compacted(OldState, NewState) ->
 erlang:demonitor(OldState#mrst.fd_monitor, [flush]),
 
 {ok, NewState#mrst{fd_monitor=Ref}}.
+
+
+recompact_retry_count() ->
+config:get_integer(
+"view_compaction",
+"recompact_retry_count",
+?DEFAULT_RECOMPACT_RETRY_COUNT
+).
```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Resolved] (COUCHDB-3182) _users upload attachment

2016-10-07 Thread Robert Newson (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-3182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Newson resolved COUCHDB-3182.

Resolution: Duplicate

> _users upload attachment
> 
>
> Key: COUCHDB-3182
> URL: https://issues.apache.org/jira/browse/COUCHDB-3182
> Project: CouchDB
>  Issue Type: Bug
>Reporter: Maxime
>
> Cannot add attachment to a document inside _users database.
> Here is the answer:
> {"error":"unknown_error","reason":"function_clause","ref":1841055428}
> Tried from fauxton and a REST client.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] couchdb-couch-mrview issue #58: Retry failures in couch_mrview_compactor:rec...

2016-10-07 Thread jaydoane
Github user jaydoane commented on the issue:

https://github.com/apache/couchdb-couch-mrview/pull/58
  
@davisp, not sure if this is exactly what you had in mind, but I thought 
I'd take a stab at it to get the ball rolling


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (COUCHDB-3184) couch_mrview_compactor:recompact/1 does not handle errors in spawned process

2016-10-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-3184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15556122#comment-15556122
 ] 

ASF GitHub Bot commented on COUCHDB-3184:
-

GitHub user jaydoane opened a pull request:

https://github.com/apache/couchdb-couch-mrview/pull/58

Retry failures in couch_mrview_compactor:recompact

Currently, if there's an error in the spawned couch_index_updater:update
process, the receive block will not match the message, and the calling
process will block forever.

This commit changes the receive pattern to match both successful updates
as well as errors, logging the errors, and retrying the recompact a
configurable number of times. If the configured retry count is exceeded,
it logs an error, and returns the original state.

COUCHDB-3184

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-couch-mrview 
3184-retry-recompact-failure

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-couch-mrview/pull/58.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #58


commit 1d5c6a5d92977308fd94b2b8f43463b9f2bdac71
Author: Jay Doane 
Date:   2016-10-07T20:04:13Z

Retry failures in couch_mrview_compactor:recompact

Currently, if there's an error in the spawned couch_index_updater:update
process, the receive block will not match the message, and the calling
process will block forever.

This commit changes the receive pattern to match both successful updates
as well as errors, logging the errors, and retrying the recompact a
configurable number of times. If the configured retry count is exceeded,
it logs an error, and returns the original state.

COUCHDB-3184




> couch_mrview_compactor:recompact/1 does not handle errors in spawned process
> 
>
> Key: COUCHDB-3184
> URL: https://issues.apache.org/jira/browse/COUCHDB-3184
> Project: CouchDB
>  Issue Type: Bug
>  Components: Database Core
>Reporter: Jay Doane
>
> The recompact function receive block only matches on tuples of the form
> {code}
> {'DOWN', Ref, _, _, {updated, Pid, State2}}
> {code}
> see: 
> https://github.com/apache/couchdb-couch-mrview/blob/master/src/couch_mrview_compactor.erl#L156
> but errors in the spawned process running couch_index_updater:update can 
> return different forms, as shown in these processes captured by a user below. 
> This results in the spawning process blocking forever in the receive.
> {code}
> (cloud...@vxpif-pclddb04.lmig.com)1> process_info(pid(0,24597,7370)).
> [{current_function,{couch_mrview_compactor,recompact,1}},
> {initial_call,{erlang,apply,2}},
> {status,waiting},
> {message_queue_len,1},
> {messages,[{'DOWN',#Ref<0.0.689040.41604>,process,
> <0.9551.7382>,
> {timeout,{gen_server,call,
> 
> [couch_proc_manager,{get_proc,<<"javascript">>},5000]}}}]},
> {links,[<0.14960.3332>,<0.4951.7370>]},
> {dictionary,[{io_priority,{view_compact,<<"shards/8000-9fff/default/master_party_db_perf.146124"...>>,
> <<"_design/sourcePrimaryKey_V">>}},
>   {task_status_props,[{changes_done,12044429},
>   
> {database,<<"shards/8000-9fff/default/master_party_db"...>>},
>   
> {design_document,<<"_design/sourcePrimaryKey_V">>},
>   {phase,view},
>   {progress,79},
>   {started_on,1471048118},
>   {total_changes,15182867},
>   {type,view_compaction},
>   {updated_on,1471048883},
>   {view,0}]},
>   {task_status_update,{{0,0,0},0}}]},
> {trap_exit,false},
> {error_handler,error_handler},
> {priority,normal},
> {group_leader,<0.237.0>},
> {total_heap_size,954562},
> {heap_size,121536},
> {stack_size,15},
> {reductions,354812127},
> {garbage_collection,[{min_bin_vheap_size,46422},
>   {min_heap_size,233},
>   {fullsweep_after,65535},
>   {minor_gcs,9}]},
> {suspending,[]}]
> (cloud...@vxpip-pclddb03.lmig.com)1> process_info(pid(0,182,3858)).
> [{current_function,{couch_mrview_compactor,recompact,1}},
> {initial_call,{erlang,apply,2}},
> {status,waiting},
> {message_queue_len,1},
> {messages,[{'DOWN',#Ref<0.0.661774.27928>,process,
> 

[GitHub] couchdb-couch-mrview pull request #58: Retry failures in couch_mrview_compac...

2016-10-07 Thread jaydoane
GitHub user jaydoane opened a pull request:

https://github.com/apache/couchdb-couch-mrview/pull/58

Retry failures in couch_mrview_compactor:recompact

Currently, if there's an error in the spawned couch_index_updater:update
process, the receive block will not match the message, and the calling
process will block forever.

This commit changes the receive pattern to match both successful updates
as well as errors, logging the errors, and retrying the recompact a
configurable number of times. If the configured retry count is exceeded,
it logs an error, and returns the original state.

COUCHDB-3184

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/cloudant/couchdb-couch-mrview 
3184-retry-recompact-failure

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/couchdb-couch-mrview/pull/58.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #58


commit 1d5c6a5d92977308fd94b2b8f43463b9f2bdac71
Author: Jay Doane 
Date:   2016-10-07T20:04:13Z

Retry failures in couch_mrview_compactor:recompact

Currently, if there's an error in the spawned couch_index_updater:update
process, the receive block will not match the message, and the calling
process will block forever.

This commit changes the receive pattern to match both successful updates
as well as errors, logging the errors, and retrying the recompact a
configurable number of times. If the configured retry count is exceeded,
it logs an error, and returns the original state.

COUCHDB-3184




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation issue #76: Fix PouchDB replication source code link

2016-10-07 Thread pnc
Github user pnc commented on the issue:

https://github.com/apache/couchdb-documentation/pull/76
  
Thanks for handling the rebase!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation pull request #76: Fix PouchDB replication source code ...

2016-10-07 Thread pnc
Github user pnc closed the pull request at:

https://github.com/apache/couchdb-documentation/pull/76


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation issue #75: Added location of default.ini and local.ini...

2016-10-07 Thread mdfw
Github user mdfw commented on the issue:

https://github.com/apache/couchdb-documentation/pull/75
  
Looks good. Thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation pull request #75: Added location of default.ini and lo...

2016-10-07 Thread mdfw
Github user mdfw closed the pull request at:

https://github.com/apache/couchdb-documentation/pull/75


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Created] (COUCHDB-3184) couch_mrview_compactor:recompact/1 does not handle errors in spawned process

2016-10-07 Thread Jay Doane (JIRA)
Jay Doane created COUCHDB-3184:
--

 Summary: couch_mrview_compactor:recompact/1 does not handle errors 
in spawned process
 Key: COUCHDB-3184
 URL: https://issues.apache.org/jira/browse/COUCHDB-3184
 Project: CouchDB
  Issue Type: Bug
  Components: Database Core
Reporter: Jay Doane


The recompact function receive block only matches on tuples of the form
{code}
{'DOWN', Ref, _, _, {updated, Pid, State2}}
{code}
see: 
https://github.com/apache/couchdb-couch-mrview/blob/master/src/couch_mrview_compactor.erl#L156

but errors in the spawned process running couch_index_updater:update can return 
different forms, as shown in these processes captured by a user below. This 
results in the spawning process blocking forever in the receive.
{code}
(cloud...@vxpif-pclddb04.lmig.com)1> process_info(pid(0,24597,7370)).
[{current_function,{couch_mrview_compactor,recompact,1}},
{initial_call,{erlang,apply,2}},
{status,waiting},
{message_queue_len,1},
{messages,[{'DOWN',#Ref<0.0.689040.41604>,process,
<0.9551.7382>,
{timeout,{gen_server,call,

[couch_proc_manager,{get_proc,<<"javascript">>},5000]}}}]},
{links,[<0.14960.3332>,<0.4951.7370>]},
{dictionary,[{io_priority,{view_compact,<<"shards/8000-9fff/default/master_party_db_perf.146124"...>>,
<<"_design/sourcePrimaryKey_V">>}},
  {task_status_props,[{changes_done,12044429},
  
{database,<<"shards/8000-9fff/default/master_party_db"...>>},
  
{design_document,<<"_design/sourcePrimaryKey_V">>},
  {phase,view},
  {progress,79},
  {started_on,1471048118},
  {total_changes,15182867},
  {type,view_compaction},
  {updated_on,1471048883},
  {view,0}]},
  {task_status_update,{{0,0,0},0}}]},
{trap_exit,false},
{error_handler,error_handler},
{priority,normal},
{group_leader,<0.237.0>},
{total_heap_size,954562},
{heap_size,121536},
{stack_size,15},
{reductions,354812127},
{garbage_collection,[{min_bin_vheap_size,46422},
  {min_heap_size,233},
  {fullsweep_after,65535},
  {minor_gcs,9}]},
{suspending,[]}]


(cloud...@vxpip-pclddb03.lmig.com)1> process_info(pid(0,182,3858)).
[{current_function,{couch_mrview_compactor,recompact,1}},
{initial_call,{erlang,apply,2}},
{status,waiting},
{message_queue_len,1},
{messages,[{'DOWN',#Ref<0.0.661774.27928>,process,
<0.17557.3858>,
{{nocatch,{os_process_error,"OS process timed out."}},
[{couch_os_process,prompt,2,

[{file,"src/couch_os_process.erl"},{line,59}]},
  {couch_query_servers,map_doc_raw,2,
  
[{file,"src/couch_query_servers.erl"},{line,84}]},
  {couch_mrview_updater,'-map_docs/2-fun-0-',3,

[{file,"src/couch_mrview_updater.erl"},{line,146}]},
  {lists,foldl,3,[{file,"lists.erl"},{line,1261}]},
  {couch_mrview_updater,map_docs,2,

[{file,"src/couch_mrview_updater.erl"},{line,153}]}]}}]},
{links,[<0.31690.3859>,<0.32697.3856>]},
{dictionary,[{io_priority,{view_compact,<<"shards/4000-5fff/default/master_party_db.1463838377">>,
<<"_design/sourcePartyIdentifier_V">>}},
  {task_status_props,[{changes_done,7905},
  
{database,<<"shards/4000-5fff/default/master_party_db"...>>},
  
{design_document,<<"_design/sourcePartyIdentifier_V">>},
  {phase,view},
  {progress,0},
  {started_on,1471298853},
  {total_changes,6261085},
  {type,view_compaction},
  {updated_on,1471298856},
  {view,0}]},
  {task_status_update,{{0,0,0},0}}]},
{trap_exit,false},
{error_handler,error_handler},
{priority,normal},
{group_leader,<0.218.0>},
{total_heap_size,364609},
{heap_size,46422},
{stack_size,15},
{reductions,230416},
{garbage_collection,[{min_bin_vheap_size,46422},
  {min_heap_size,233},
  {fullsweep_after,65535},
  {minor_gcs,3}]},
{suspending,[]}]
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] couchdb-documentation issue #76: Fix PouchDB replication source code link

2016-10-07 Thread nickva
Github user nickva commented on the issue:

https://github.com/apache/couchdb-documentation/pull/76
  
I rebased your pr on master and merged it. 

Check to see it is there and you can close the pr.

Thanks again!



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation pull request #73: Add documentation for compiler flags

2016-10-07 Thread nickva
Github user nickva commented on a diff in the pull request:

https://github.com/apache/couchdb-documentation/pull/73#discussion_r82412373
  
--- Diff: src/install/unix.rst ---
@@ -134,7 +134,7 @@ To build CouchDB you should run::
 
 Try ``gmake`` if ``make`` is giving you any problems.
 
-If include paths or other compiler options must be specified, they can be 
passed to rebar, which compiles Couch, with the ERL_CFLAGS environment 
variable. Likewise, options may be passed to the linker with the ERL_LDFLAGS 
environment variable.::
+If include paths or other compiler options must be specified, they can be 
passed to rebar, which compiles Couch, with the ERL_CFLAGS environment 
variable. Likewise, options may be passed to the linker with the ERL_LDFLAGS 
environment variable::
--- End diff --

Let's use CouchDB instead of Couch for consistency in the file.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation issue #75: Added location of default.ini and local.ini...

2016-10-07 Thread nickva
Github user nickva commented on the issue:

https://github.com/apache/couchdb-documentation/pull/75
  
+1

Thanks @mdfw ! 

I fixed the BSD escape character on master already. Would you mind rebasing 
on master and skip that commit and then I'll merge your changes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation issue #65: Describe errors if there are problems with ...

2016-10-07 Thread nickva
Github user nickva commented on the issue:

https://github.com/apache/couchdb-documentation/pull/65
  
Rebased on master and merged. Closing pr.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation issue #65: Describe errors if there are problems with ...

2016-10-07 Thread nickva
Github user nickva commented on the issue:

https://github.com/apache/couchdb-documentation/pull/65
  
+1

Thanks, Adrian!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation pull request #77: Escape wildcard in *BSD to appease r...

2016-10-07 Thread pnc
Github user pnc closed the pull request at:

https://github.com/apache/couchdb-documentation/pull/77


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation issue #74: Escape asterisk so the build stops complain...

2016-10-07 Thread nickva
Github user nickva commented on the issue:

https://github.com/apache/couchdb-documentation/pull/74
  
I fixed this in a different pr before seeing yours.  Master should build 
again now.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation issue #76: Fix PouchDB replication source code link

2016-10-07 Thread nickva
Github user nickva commented on the issue:

https://github.com/apache/couchdb-documentation/pull/76
  
+1, thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (COUCHDB-3174) max_document_size setting can by bypassed by issuing multipart/related requests

2016-10-07 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-3174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1296#comment-1296
 ] 

ASF GitHub Bot commented on COUCHDB-3174:
-

Github user nickva closed the pull request at:

https://github.com/apache/couchdb-documentation/pull/78


> max_document_size setting can by bypassed by issuing multipart/related 
> requests
> ---
>
> Key: COUCHDB-3174
> URL: https://issues.apache.org/jira/browse/COUCHDB-3174
> Project: CouchDB
>  Issue Type: Bug
>Reporter: Nick Vatamaniuc
> Attachments: attach_large.py
>
>
> Testing how replicator handled small values of max_document_size parameter, 
> discovered if user issues PUT requests which are multipart/related, then 
> max_document_size setting is bypassed.
> Wireshark capture of a PUT with attachments request coming from replicator in 
> a EUnit test I wrote.  max_document_size was set to 1 yet a 70k byte 
> document with a 70k byte attachment was created.
> {code}
> PUT /eunit-test-db-147555017168185/doc0?new_edits=false HTTP/1.1
> Content-Type: multipart/related; boundary="e5d21d5fd988dc1c6c6e8911030213b3"
> Content-Length: 140515
> Accept: application/json
> --e5d21d5fd988dc1c6c6e8911030213b3
> Content-Type: application/json
> {"_id":"doc0","_rev":"1-40a6a02761aba1474c4a1ad9081a4c2e","x":"
> ...","_revisions":{"start":1,"ids":["40a6a02761aba1474c4a1ad9081a4c2e"]},"_attachments":{"att1":{"content_type":"app/binary","revpos":1,"digest":"md5-u+COd6RLUd6BGz0wJyuZFg==","length":7,"follows":true}}}
> --e5d21d5fd988dc1c6c6e8911030213b3
> Content-Disposition: attachment; filename="att1"
> Content-Type: app/binary
> Content-Length: 7
> xx
> --e5d21d5fd988dc1c6c6e8911030213b3--
> HTTP/1.1 201 Created
> {code}
> Here is a regular request which works as expected:
> {code}
> PUT /dbl/dl2 HTTP/1.1
> Content-Length: 100026
> Content-Type: application/json
> Accept: application/json
> {"_id": "dl2", "size": "...xxx"}
> HTTP/1.1 413 Request Entity Too Large
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] couchdb-documentation pull request #78: Update max_document_size description...

2016-10-07 Thread nickva
Github user nickva closed the pull request at:

https://github.com/apache/couchdb-documentation/pull/78


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-documentation pull request #79: Fix an asterisk escape in unix insta...

2016-10-07 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/couchdb-documentation/pull/79


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Resolved] (COUCHDB-3174) max_document_size setting can by bypassed by issuing multipart/related requests

2016-10-07 Thread Nick Vatamaniuc (JIRA)

 [ 
https://issues.apache.org/jira/browse/COUCHDB-3174?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Nick Vatamaniuc resolved COUCHDB-3174.
--
Resolution: Fixed

> max_document_size setting can by bypassed by issuing multipart/related 
> requests
> ---
>
> Key: COUCHDB-3174
> URL: https://issues.apache.org/jira/browse/COUCHDB-3174
> Project: CouchDB
>  Issue Type: Bug
>Reporter: Nick Vatamaniuc
> Attachments: attach_large.py
>
>
> Testing how replicator handled small values of max_document_size parameter, 
> discovered if user issues PUT requests which are multipart/related, then 
> max_document_size setting is bypassed.
> Wireshark capture of a PUT with attachments request coming from replicator in 
> a EUnit test I wrote.  max_document_size was set to 1 yet a 70k byte 
> document with a 70k byte attachment was created.
> {code}
> PUT /eunit-test-db-147555017168185/doc0?new_edits=false HTTP/1.1
> Content-Type: multipart/related; boundary="e5d21d5fd988dc1c6c6e8911030213b3"
> Content-Length: 140515
> Accept: application/json
> --e5d21d5fd988dc1c6c6e8911030213b3
> Content-Type: application/json
> {"_id":"doc0","_rev":"1-40a6a02761aba1474c4a1ad9081a4c2e","x":"
> ...","_revisions":{"start":1,"ids":["40a6a02761aba1474c4a1ad9081a4c2e"]},"_attachments":{"att1":{"content_type":"app/binary","revpos":1,"digest":"md5-u+COd6RLUd6BGz0wJyuZFg==","length":7,"follows":true}}}
> --e5d21d5fd988dc1c6c6e8911030213b3
> Content-Disposition: attachment; filename="att1"
> Content-Type: app/binary
> Content-Length: 7
> xx
> --e5d21d5fd988dc1c6c6e8911030213b3--
> HTTP/1.1 201 Created
> {code}
> Here is a regular request which works as expected:
> {code}
> PUT /dbl/dl2 HTTP/1.1
> Content-Length: 100026
> Content-Type: application/json
> Accept: application/json
> {"_id": "dl2", "size": "...xxx"}
> HTTP/1.1 413 Request Entity Too Large
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (COUCHDB-3174) max_document_size setting can by bypassed by issuing multipart/related requests

2016-10-07 Thread Nick Vatamaniuc (JIRA)

[ 
https://issues.apache.org/jira/browse/COUCHDB-3174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1211#comment-1211
 ] 

Nick Vatamaniuc commented on COUCHDB-3174:
--

The issue is not 100% fixed, but it should help against accidental cases

> max_document_size setting can by bypassed by issuing multipart/related 
> requests
> ---
>
> Key: COUCHDB-3174
> URL: https://issues.apache.org/jira/browse/COUCHDB-3174
> Project: CouchDB
>  Issue Type: Bug
>Reporter: Nick Vatamaniuc
> Attachments: attach_large.py
>
>
> Testing how replicator handled small values of max_document_size parameter, 
> discovered if user issues PUT requests which are multipart/related, then 
> max_document_size setting is bypassed.
> Wireshark capture of a PUT with attachments request coming from replicator in 
> a EUnit test I wrote.  max_document_size was set to 1 yet a 70k byte 
> document with a 70k byte attachment was created.
> {code}
> PUT /eunit-test-db-147555017168185/doc0?new_edits=false HTTP/1.1
> Content-Type: multipart/related; boundary="e5d21d5fd988dc1c6c6e8911030213b3"
> Content-Length: 140515
> Accept: application/json
> --e5d21d5fd988dc1c6c6e8911030213b3
> Content-Type: application/json
> {"_id":"doc0","_rev":"1-40a6a02761aba1474c4a1ad9081a4c2e","x":"
> ...","_revisions":{"start":1,"ids":["40a6a02761aba1474c4a1ad9081a4c2e"]},"_attachments":{"att1":{"content_type":"app/binary","revpos":1,"digest":"md5-u+COd6RLUd6BGz0wJyuZFg==","length":7,"follows":true}}}
> --e5d21d5fd988dc1c6c6e8911030213b3
> Content-Disposition: attachment; filename="att1"
> Content-Type: app/binary
> Content-Length: 7
> xx
> --e5d21d5fd988dc1c6c6e8911030213b3--
> HTTP/1.1 201 Created
> {code}
> Here is a regular request which works as expected:
> {code}
> PUT /dbl/dl2 HTTP/1.1
> Content-Length: 100026
> Content-Type: application/json
> Accept: application/json
> {"_id": "dl2", "size": "...xxx"}
> HTTP/1.1 413 Request Entity Too Large
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)