title: Why does ArangoDB (using Python-Arango) return ERR 1600 ERROR_CURSOR_NOT_FOUND?
body: <h1>The problem</h1>
  
  <p>I iterate over an entire vertex collection, e.g. <code>journals</code>, and use it to create edges, <code>author</code>, from a <code>person</code> to the given <code>journal</code>.</p>
  
  <p>I use <a href="https://python-driver-for-arangodb.readthedocs.io" rel="nofollow noreferrer">python-arango</a> and the code is something like:</p>
  
  <pre><code>for journal in journals.all():
      create_author_edge(journal)
  </code></pre>
  
  <p>I have a relatively small dataset, and the <code>journals</code>-collection has only ca. 1300 documents. However: this is <em>more than 1000</em>, which is the batch size in the Web Interface - but I don't know if this is of relevance.</p>
  
  <p>The problem is that it raises a <a href="http://python-driver-for-arangodb.readthedocs.io/en/master/errors.html#arango.exceptions.CursorNextError" rel="nofollow noreferrer"><code>CursorNextError</code></a>, and returns <code>HTTP 404</code> and <code>ERR 1600</code> from the database, which is the <a href="https://docs.arangodb.com/3.3/Manual/Appendix/ErrorCodes.html#arangodb-cursor-errors" rel="nofollow noreferrer"><code>ERROR_CURSOR_NOT_FOUND</code> error</a>:</p>
  
  <blockquote>
    <p>Will be raised when a cursor is requested via its id but a cursor with that id cannot be found.</p>
  </blockquote>
  
  <h1>Insights to the cause</h1>
  
  <p>From <a href="https://stackoverflow.com/questions/27304963/arangodb-cursor-timeout">ArangoDB Cursor Timeout</a>, and from <a href="https://github.com/joowani/python-arango/issues/63" rel="nofollow noreferrer">this issue</a>, I suspect that it's because the cursor's TTL has expired in the database, and in the python stacktrace something like this is seen:</p>
  
  <pre><code># Part of the stacktrace in the error:
  (...)
  if not cursor.has_more():
      raise StopIteration
  cursor.fetch()  &lt;---- error raised here
  (...)
  </code></pre>
  
  <p>If I iterate over the entire collection fast, i.e. if I do <code>print(len(journals.all())</code> it outputs "1361" with no errors.</p>
  
  <p>When I replace the <code>journals.all()</code> with AQL, and increase the <code>TTL</code> parameter, it works without errors:</p>
  
  <pre><code>for journal in db.aql.execute("FOR j IN journals RETURN j", ttl=3600):
      create_author_edge(journal)
  </code></pre>
  
  <p>However, without the the <code>ttl</code>-parameter, the AQL approach gives the same error as using <code>journals.all()</code>.</p>
  
  <h1>More information</h1>
  
  <p>A last piece of information is that I'm running this on my personal laptop when the error is raised. On my work computer, the same code was used to create the graph and populate it with the same data, but there no errors were raised. Because I'm on holiday I don't have access to my work computer to compare versions, but both systems were installed during the summer so there's a big chance the versions are the same.</p>
  
  <h1>The question</h1>
  
  <p>I don't know if this is an issue with python-arango, or with ArangoDB. I believe that because there is no problem when TTL is increased that it could indicate an issue with ArangodDB and not the Python driver, but I cannot know.</p>
  
  <p>(I've added a feature request to add ttl-param to the <code>.all()</code>-method <a href="https://github.com/joowani/python-arango/issues/82" rel="nofollow noreferrer">here</a>.)</p>
  
  <p>Any insights into why this is happening?</p>
  
  <hr/>
  
  <p><em>I don't have the rep to create the tag "python-arango", so it would be great if someone would create it and tag my question.</em></p>