# First install with PG10 fails

**URL:** <https://forum.gitea.com/t/first-install-with-pg10-fails/2050>\
**Category:** Install/Maintain/Configure\
**Created:** [March 30, 2020, 1:07pm UTC](https://forum.gitea.com/t/first-install-with-pg10-fails/2050 "2020-03-30T13:07:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fragadass](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@fragadass](https://forum.gitea.com/u/fragadass)\
**Post date:** [March 30, 2020, 1:07pm UTC](https://forum.gitea.com/t/first-install-with-pg10-fails/2050/1 "2020-03-30T13:07:36Z")

</div>

Hi.

I’ve got a problem with a new installation, from binary 1.11.3, on Ubuntu 18 LTS with a PostgreSQL 10 database.

I’ve followed the official instructions for this type of installation, except that /var/lib/gitea and /etc/gitea are symlinks to ~/var/gitea and ~/etc/gitea  
I have to do this because of my enterprise environnement rules, but I’ve put the recursive rights and owners as described in the Gitea documentation.

Here is my start procedure :

> git@…:~/product/gitea/1.11.3$ GITEA\_WORK\_DIR=/var/lib/gitea/ ./gitea web -c /etc/gitea/app.ini -p 8080

The web page is ok (with Apache 2.4.29), then I go to Explore to have the web installation page.  
I fill the required fields, then some facultative ones and click on Install.

All seems to be ok, tables and objects are created in the database, and the last on-screen message is :

> 2020/03/30 14:19:50 …dules/setting/git.go:91:newGit() [I] Git Version: 2.17.1

And in the /home/git/var/lib/gitea/log/gitea.log file, I’ve got this error :

> 2020/03/30 14:19:50 routers/init.go:72:initDBEngine() [E] ORM engine initialization attempt #1/10 failed. Error: migrate: sync: pq: column “id” of relation “version” already exists

I’ve got 10 attemps before le script exits and the webpage asks me to leave or stay on itself.

Can you help me ?

---

<div class="post-metadata">

**Author:** ![guillep2k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/guillep2k/32/646_2.png) [@guillep2k](https://forum.gitea.com/u/guillep2k)\
**Post date:** [March 31, 2020, 4:29am UTC](https://forum.gitea.com/t/first-install-with-pg10-fails/2050/2 "2020-03-31T04:29:52Z")

</div>

Hi, this looks like you made a couple of installation attempts and one of them left the database half-created. Now Gitea thinks you’re upgrading when in fact you’re not. I’d suggest you drop and recreate the database and try again.

---

<div class="post-metadata">

**Author:** ![fragadass](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@fragadass](https://forum.gitea.com/u/fragadass)\
**Post date:** [March 31, 2020, 7:39am UTC](https://forum.gitea.com/t/first-install-with-pg10-fails/2050/3 "2020-03-31T07:39:29Z")

</div>

Hi @guillep2k.

Thanks for the answer. I’ve already tried a few times and before opening this thread, I’ve done what you asked :

- Clean and delete all directories created for gitea
- Drop database and instance Postgres
- Recreate all

Maybe a option in the app.ini file to deactivate the upgrade mode ?
