# Gramps --open="XXX" --action=book error

**URL:** <https://gramps.discourse.group/t/gramps-open-xxx-action-book-error/6501>\
**Category:** Bug triage\
**Created:** [November 28, 2024, 1:30pm UTC](https://gramps.discourse.group/t/gramps-open-xxx-action-book-error/6501 "2024-11-28T13:30:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![LaurentMarquet](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/laurentmarquet/32/5073_2.png) [@LaurentMarquet](https://gramps.discourse.group/u/LaurentMarquet)\
**Post date:** [November 28, 2024, 1:30pm UTC](https://gramps.discourse.group/t/gramps-open-xxx-action-book-error/6501/1 "2024-11-28T13:30:48Z")

</div>

Hi,  
I’m running `gramps --open="XXX" --action=book --options="name=YYY,off=pdf,of=File.pdf"`.  
It works wih one book but not with another and I receive:

```python
Ouverture réussie !
Action demandée : book.
Utilisation de la chaîne d'options : name=YYY,off=pdf,of=File.pdf
100% Application...
100% Collecte des données...
100% Tri des données...
ReportError L'individu n'est pas présent dans la base de données 
100% Application...
100% Enregistrement des diagrammes...
100% Application...
100% Recherche de la période...
100% Application...
100% Tri des dates...
100% Calcul de la période...
2024-11-28 13:37:27.996: ERROR: grampsapp.py: line 188: Unhandled exception
Traceback (most recent call last):
  File "/usr/bin/gramps", line 3, in <module>
    app.main()
  File "/usr/lib/python3/dist-packages/gramps/grampsapp.py", line 686, in main
    errors = run()
             ^^^^^
  File "/usr/lib/python3/dist-packages/gramps/grampsapp.py", line 678, in run
    startcli(error, argpars)
  File "/usr/lib/python3/dist-packages/gramps/cli/grampscli.py", line 379, in startcli
    handler.handle_args_cli()
  File "/usr/lib/python3/dist-packages/gramps/cli/arghandler.py", line 481, in handle_args_cli
    self.cl_action(action, op_string)
  File "/usr/lib/python3/dist-packages/gramps/cli/arghandler.py", line 746, in cl_action
    cl_book(
  File "/usr/lib/python3/dist-packages/gramps/cli/plug/ __init__.py", line 911, in cl_book
    rpt.begin_report()
    ^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'begin_report'

```

If anyone has an idea 🙂

---

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [November 28, 2024, 1:57pm UTC](https://gramps.discourse.group/t/gramps-open-xxx-action-book-error/6501/2 "2024-11-28T13:57:05Z")

</div>

What happens if you try to create this book from the menu?

---

<div class="post-metadata">

**Author:** ![LaurentMarquet](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/laurentmarquet/32/5073_2.png) [@LaurentMarquet](https://gramps.discourse.group/u/LaurentMarquet)\
**Post date:** [November 28, 2024, 2:05pm UTC](https://gramps.discourse.group/t/gramps-open-xxx-action-book-error/6501/3 "2024-11-28T14:05:56Z")

</div>

It works well when created from menu

---

<div class="post-metadata">

**Author:** ![Nick-Hall](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/nick-hall/32/95_2.png) [@Nick-Hall](https://gramps.discourse.group/u/Nick-Hall)\
**Post date:** [November 28, 2024, 2:16pm UTC](https://gramps.discourse.group/t/gramps-open-xxx-action-book-error/6501/4 "2024-11-28T14:16:17Z")

</div>

The important error line is:

`ReportError L'individu n'est pas présent dans la base de données`

It looks like a report is failing because it needs a centre person to be specified. It is trying to use an empty string.

Try using the “pid” report option to specify the Gramps ID of a centre person.

---

<div class="post-metadata">

**Author:** ![LaurentMarquet](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/laurentmarquet/32/5073_2.png) [@LaurentMarquet](https://gramps.discourse.group/u/LaurentMarquet)\
**Post date:** [November 28, 2024, 2:20pm UTC](https://gramps.discourse.group/t/gramps-open-xxx-action-book-error/6501/5 "2024-11-28T14:20:33Z")

</div>

Great idea, but now it gives `Les options valides sont : of, off, style, papers, papero, paperml, papermr, papermt, papermb` saying pid is not allowed, while using `gramps --open="XXX" --action=book --options="name=YYY,off=pdf,of=File.pdf,pid=I0001";`

---

<div class="post-metadata">

**Author:** ![ennoborg](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/ennoborg/32/4659_2.png) [@ennoborg](https://gramps.discourse.group/u/ennoborg)\
**Post date:** [November 28, 2024, 2:44pm UTC](https://gramps.discourse.group/t/gramps-open-xxx-action-book-error/6501/6 "2024-11-28T14:44:02Z")

</div>

OK, let me guess. I never use the [command line](https://gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Command_Line) this way, but I am assuming that XXX is the name of your tree, and YYY is the base name of the report file. Is that right?

If it is, it seems like the report code is wrong, because it does not accept the PID argument, which it needs to find the start person. There’s more wrong with it, because if the person can’t be found, it should quit in a more friendly way, not throw an exception like this one.

---

<div class="post-metadata">

**Author:** ![emyoulation](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/emyoulation/32/67_2.png) [@emyoulation](https://gramps.discourse.group/u/emyoulation)\
**Post date:** [November 28, 2024, 2:50pm UTC](https://gramps.discourse.group/t/gramps-open-xxx-action-book-error/6501/7 "2024-11-28T14:50:43Z")

</div>

If this CLI command is running a Book, not a report, does that change parameter passing expectations?

Perhaps the Book was created for one Tree and is being applied to a different one. So the parameters for a report in the Book don’t pertain to the other Tree?

---

<div class="post-metadata">

**Author:** ![LaurentMarquet](https://yyz2.discourse-cdn.com/free1/user_avatar/gramps.discourse.group/laurentmarquet/32/5073_2.png) [@LaurentMarquet](https://gramps.discourse.group/u/LaurentMarquet)\
**Post date:** [November 28, 2024, 2:54pm UTC](https://gramps.discourse.group/t/gramps-open-xxx-action-book-error/6501/8 "2024-11-28T14:54:30Z")

</div>

Yes XXX is the name of my tree and YYY the final filename.  
The book that works doesn’t require any id as it’s only statistics of the database.  
The one that doesn’t work, yes, is based on a person in the software, so maybe I can’t do this book. I’m just beginning in the use of the [command line](https://gramps-project.org/wiki/index.php/Gramps_5.2_Wiki_Manual_-_Command_Line)
