I can reproduce this (latest git version) if the clocktable declaration lies before the first heading.
Minimal example: ============================================================ bla bla #+BEGIN: clocktable :maxlevel 7 :block yesterday :scope tree1 #+END: bla bla * heading1 :LOGBOOK: CLOCK: [2012-08-22 Wed 14:18]--[2012-08-22 Wed 14:18] => 0:00 :END: ** heading2 * otherheading1 ============================================================ Position 2048 refers to the (character) position of the clocktable declaration. Debug trace: ============================================================ signal(error ("Before first headline at position 83 in buffer pepe.org")) error("Before first headline at position %d in buffer %s" 83 #<buffer pepe.org>) (condition-case nil (outline-back-to-heading invisible-ok) (error (error "Before first headline at position %d in buffer %s" (point) (current-buffer)))) org-back-to-heading(t) (let (start-level re) (org-back-to-heading t) (setq start-level (funcall outline-level)) (if (equal start-level 1) nil (setq re (concat "^\\*\\{1," (number-to-string (1- start-level)) "\\} ")) (if (re-search-backward re nil t) (funcall outline-level)))) org-up-heading-safe() ... ============================================================ On Wed, Aug 22, 2012 at 07:10:10PM +0200, Bastien wrote: > Esben Stien <b...@esben-stien.name> writes: > > > I've stumbled into serious trouble with my org file. > > What version of org are you using? > > > I C-c C-c over: > > > > #+BEGIN: clocktable :maxlevel 7 :block yesterday :scope tree1 > > > > , but I get: > > > > condition-case: Before first headline at position 2408 in buffer agenda.org > > > > I cannot figure out what's wrong; there's nothing special at line 2408 > > > > Is there some way to debug this? > > Can you make a minimal example to help us reproduce this? > > Thanks, >