# File contains no section headers when initialize database

**URL:** https://discuss.tryton.org/t/file-contains-no-section-headers-when-initialize-database/5701
**Category:** System Administrator
**Created:** [November 14, 2022, 5:12am UTC](https://discuss.tryton.org/t/file-contains-no-section-headers-when-initialize-database/5701 "2022-11-14T05:12:49Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Turi](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@Turi](https://discuss.tryton.org/u/Turi)
#### Post date: [November 14, 2022, 5:12am UTC](https://discuss.tryton.org/t/file-contains-no-section-headers-when-initialize-database/5701/1 "2022-11-14T05:12:50Z")

</div>

I am installing tryton for the first time after running the command

> trytond-admin -c /etc/tryton/tryton.conf -d tryton --all

I am getting this error which i am unable to find google.

```auto
Traceback (most recent call last):
  File "/home/hassan/.local/bin/trytond-admin", line 18, in <module>
    config.update_etc(options.configfile)
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/config.py", line 84, in update_etc
    read_files = self.read(configfile)
  File "/usr/lib/python2.7/ConfigParser.py", line 305, in read
    self._read(fp, filename)
  File "/usr/lib/python2.7/ConfigParser.py", line 512, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
file: /etc/tryton/tryton.conf, line: 1
'path = /home/etc/tryton/\n'

```

---

<div class="post-metadata">

### Author: ![Turi](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@Turi](https://discuss.tryton.org/u/Turi)
#### Post date: [November 14, 2022, 5:19am UTC](https://discuss.tryton.org/t/file-contains-no-section-headers-when-initialize-database/5701/2 "2022-11-14T05:19:59Z")

</div>

Sometimes this errors occurs

```auto
 raise IOError('Database "%s" doesn\'t exist!' % db_filename)
IOError: Database "tryton.sqlite" doesn't exist!

```

I dont understand i am using `postgres` then why is it giving me error of `sqlite`

---

<div class="post-metadata">

### Author: ![maxx](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/maxx/32/2320_2.png) [@maxx](https://discuss.tryton.org/u/maxx)
#### Post date: [November 14, 2022, 6:32am UTC](https://discuss.tryton.org/t/file-contains-no-section-headers-when-initialize-database/5701/3 "2022-11-14T06:32:28Z")

</div>

It seems your tryton.conf is misconfigured.

See documentation here: [Configuration file — Tryton server](https://docs.tryton.org/projects/server/en/latest/topics/configuration.html#topics-configuration)

---

<div class="post-metadata">

### Author: ![Turi](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@Turi](https://discuss.tryton.org/u/Turi)
#### Post date: [November 14, 2022, 6:36am UTC](https://discuss.tryton.org/t/file-contains-no-section-headers-when-initialize-database/5701/4 "2022-11-14T06:36:38Z")

</div>

this is my configuration file

```auto
path = /Tryton/tryton.conf

[web]
listen=127.0.0.1:8000
root = /home/hassan
hostname = hassan

[database]
# uri = database://username:password@host:port/
uri=postgresql://xxxx:xxxx@127.0.0.1:5432/tryton

[jsonrpc]
# Settings for the JSON-RPC network interface
listen=127.0.0.1:8000
data=/tryton/sao

```

---

<div class="post-metadata">

### Author: ![dotbit](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/dotbit/32/2093_2.png) [@dotbit](https://discuss.tryton.org/u/dotbit)
#### Post date: [November 14, 2022, 7:03am UTC](https://discuss.tryton.org/t/file-contains-no-section-headers-when-initialize-database/5701/5 "2022-11-14T07:03:55Z")

</div>

> [@Turi](#):
>
> `path = /Tryton/tryton.conf`

This is certainly a problem. Try testing without this line.

Do try to test one change at a time.  
Start with an almost empty file, and add one line at a time, test and see if it has the expected result.

---

<div class="post-metadata">

### Author: ![Turi](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@Turi](https://discuss.tryton.org/u/Turi)
#### Post date: [November 14, 2022, 7:27am UTC](https://discuss.tryton.org/t/file-contains-no-section-headers-when-initialize-database/5701/7 "2022-11-14T07:27:55Z")

</div>

this error changed to

```auto
Traceback (most recent call last):
  File "/home/hassan/.local/bin/trytond-admin", line 21, in <module>
    admin.run(options)
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/admin.py", line 54, in run
    installdeps=options.installdeps)
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/pool.py", line 152, in init
    self.start()
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/pool.py", line 105, in start
    register_classes()
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/modules/ __init__.py", line 341, in register_classes
    import trytond.ir
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/ir/ __init__.py", line 5, in <module>
    from .translation import *
  File "/home/hassan/.local/lib/python2.7/site-packages/trytond/ir/translation.py", line 19, in <module>
    from relatorio.reporting import MIMETemplateLoader
  File "/home/hassan/.local/lib/python2.7/site-packages/relatorio/ __init__.py", line 12, in <module>
    from . import templates
  File "/home/hassan/.local/lib/python2.7/site-packages/relatorio/templates/ __init__.py", line 6, in <module>
    __import__ ('relatorio.templates.%s' % name)
  File "/home/hassan/.local/lib/python2.7/site-packages/relatorio/templates/opendocument.py", line 16, in <module>
    import urllib.parse
ImportError: No module named parse

```

I tried

> pip install parse

which I found from stackoverflow but still issue

---

<div class="post-metadata">

### Author: ![dotbit](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/dotbit/32/2093_2.png) [@dotbit](https://discuss.tryton.org/u/dotbit)
#### Post date: [November 14, 2022, 7:34am UTC](https://discuss.tryton.org/t/file-contains-no-section-headers-when-initialize-database/5701/8 "2022-11-14T07:34:09Z")

</div>

To me it seems like you have a problem with the trytond installation.  
How did you install trytond?

What version of trytond are you using?  
Btw, please try to use the latest (6.6).  
Also Python 2.x is deprecated, so you should use at least 3.7+

---

<div class="post-metadata">

### Author: ![Turi](https://discuss-cdn.tryton.org/letter_avatar_proxy/v4/letter/t/977dab/32.png) [@Turi](https://discuss.tryton.org/u/Turi)
#### Post date: [November 14, 2022, 7:35am UTC](https://discuss.tryton.org/t/file-contains-no-section-headers-when-initialize-database/5701/9 "2022-11-14T07:35:39Z")

</div>

I am using python2.7 and trytond 4.8 as per my organization requirements. cant shift to latest. any solution for python2.7 and trytond 4.8

---

<div class="post-metadata">

### Author: ![dotbit](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/dotbit/32/2093_2.png) [@dotbit](https://discuss.tryton.org/u/dotbit)
#### Post date: [November 14, 2022, 7:50am UTC](https://discuss.tryton.org/t/file-contains-no-section-headers-when-initialize-database/5701/10 "2022-11-14T07:50:24Z")

</div>

I guess the oldest LTS [release](https://discuss.tryton.org/t/release-process/395) is 5.0

So 4.8 is unsupported, also I do not have experience with that version.

From my point of view, we are trying to make current tryton better, so I am guessing you need to get [commercial support](https://www.tryton.org/service-providers) for 4.8.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [November 14, 2022, 8:07am UTC](https://discuss.tryton.org/t/file-contains-no-section-headers-when-initialize-database/5701/11 "2022-11-14T08:07:59Z")

</div>

> [@Turi](#):
>
> I am using python2.7 and trytond 4.8 as per my organization requirements.

Python2.7 [is deprecated since 1st January 2020](https://www.python.org/doc/sunset-python-2/)

Tryton 4.8 is the latest version that supported Python2.7 and is also deprecated since November 2019.

I will recomend switching to python3 which will support newer series which are alreay mantained.

> [@Turi](#):
>
> ```auto
> File "/home/hassan/.local/lib/python2.7/site-packages/relatorio/templates/ __init__.py", line 6, in <module>
> __import__ ('relatorio.templates.%s' % name)
> File "/home/hassan/.local/lib/python2.7/site-packages/relatorio/templates/opendocument.py", line 16, in <module>
> import urllib.parse
> ImportError: No module named parse
> 
> ```

The problem is that you are using a relatorio version which only support Python3, but as you are using python2 an error is raised. You should downgrade to a version that supports python2.

I guess you will have the same issue for other required libraries so it will be easier to upgrade your python version than downgrading all dependencies.
