For the ‘Request too large’ problem, it is because the request length is indeed too large and Yogi’s idea is right.
/usr/lib/python2.7/site-packages/bottle.py:
(Pdb) l
1178 ''' read body until content-length or MEMFILE_MAX into a string. Raise
1179 HTTPError(413) on requests that are to large. '''
1180 clen = self.content_length
1181 if clen > self.MEMFILE_MAX:
1182 import pdb; pdb.set_trace()
1183 -> raise HTTPError(413, 'Request to large')
1184 if clen < 0: clen = self.MEMFILE_MAX + 1
1185 data = self.body.read(clen)
1186 if len(data) > self.MEMFILE_MAX: # Fail fast
1187 raise HTTPError(413, 'Request to large')
1188 return data
(Pdb) p self.MEMFILE_MAX
1024000
(Pdb) p clen
1063685
(Pdb)
As we can see, the size of request to create 1500 rules is larger than 1024000. In this case, you can set the ‘max_request_size’ to a larger number in contrail-api.conf file.
For the ‘Request too large’ problem, it is because the request length is indeed too large and Yogi’s idea is right.
/usr/lib/ python2. 7/site- packages/ bottle. py:
(Pdb) l read(clen)
1178 ''' read body until content-length or MEMFILE_MAX into a string. Raise
1179 HTTPError(413) on requests that are to large. '''
1180 clen = self.content_length
1181 if clen > self.MEMFILE_MAX:
1182 import pdb; pdb.set_trace()
1183 -> raise HTTPError(413, 'Request to large')
1184 if clen < 0: clen = self.MEMFILE_MAX + 1
1185 data = self.body.
1186 if len(data) > self.MEMFILE_MAX: # Fail fast
1187 raise HTTPError(413, 'Request to large')
1188 return data
(Pdb) p self.MEMFILE_MAX
1024000
(Pdb) p clen
1063685
(Pdb)
As we can see, the size of request to create 1500 rules is larger than 1024000. In this case, you can set the ‘max_request_size’ to a larger number in contrail-api.conf file.