# ERROR column answered

**URL:** <https://wazo-platform.discourse.group/t/error-column-answered/737>\
**Category:** English\
**Created:** [February 26, 2021, 6:14pm UTC](https://wazo-platform.discourse.group/t/error-column-answered/737 "2021-02-26T18:14:14Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiousi](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/hiousi/32/378_2.png) [@hiousi](https://wazo-platform.discourse.group/u/hiousi)\
**Post date:** [February 26, 2021, 6:14pm UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/1 "2021-02-26T18:14:14Z")

</div>

After upgrading to 21.02 I get the following error:

ERREUR: la colonne « answered » de la relation « call\_log\_participant » n’existe pas

I suppose database was not upgraded for some reason.  
Should I run an updrade script to solve this issue ?

---

<div class="post-metadata">

**Author:** ![quintana](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/quintana/32/916_2.png) [@quintana](https://wazo-platform.discourse.group/u/quintana)\
**Post date:** [February 26, 2021, 11:24pm UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/2 "2021-02-26T23:24:40Z")

</div>

How did you upgrade your wazo?

---

<div class="post-metadata">

**Author:** ![hiousi](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/hiousi/32/378_2.png) [@hiousi](https://wazo-platform.discourse.group/u/hiousi)\
**Post date:** [February 27, 2021, 9:40am UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/3 "2021-02-27T09:40:54Z")

</div>

wazo-upgrade but just after running it I just saw that postgres password was changed,  
in the log:  
FATAL: authentification par mot de passe échouée pour l’utilisateur « postgres »

After reseting the default password wazo-upgrade runned without any error. But still have a  
ERREUR: la colonne « answered » de la relation « call\_log\_participant » n’existe pas

---

<div class="post-metadata">

**Author:** ![fblackburn](https://avatars.discourse-cdn.com/v4/letter/f/51bf81/32.png) [@fblackburn](https://wazo-platform.discourse.group/u/fblackburn)\
**Post date:** [March 2, 2021, 1:03pm UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/4 "2021-03-02T13:03:25Z")

</div>

You can run the following command to fix it:

```auto
xivo-update-db

```

Then you can check the status with:

```auto
xivo-check-db

```

---

<div class="post-metadata">

**Author:** ![hiousi](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/hiousi/32/378_2.png) [@hiousi](https://wazo-platform.discourse.group/u/hiousi)\
**Post date:** [March 3, 2021, 5:22pm UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/5 "2021-03-03T17:22:21Z")

</div>

> [@fblackburn](#):
>
> ```auto
> xivo-update-db
> 
> ```

```auto
~# xivo-update-db
Updating database...
Updating database done.

```

and

```auto
~# xivo-check-db
Checking database...
	OK

```

but still have a 500 error:

```auto
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) ERREUR: la colonne call_log_participant_1.answered n'existe pas

```

---

<div class="post-metadata">

**Author:** ![hiousi](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/hiousi/32/378_2.png) [@hiousi](https://wazo-platform.discourse.group/u/hiousi)\
**Post date:** [March 3, 2021, 5:47pm UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/6 "2021-03-03T17:47:47Z")

</div>

need advice, what is the simpler way?

- adding manually the missing column in db
- (re)start on a fresh install and migrate all my settings (how?)
- or else?

---

<div class="post-metadata">

**Author:** ![fblackburn](https://avatars.discourse-cdn.com/v4/letter/f/51bf81/32.png) [@fblackburn](https://wazo-platform.discourse.group/u/fblackburn)\
**Post date:** [March 3, 2021, 6:27pm UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/7 "2021-03-03T18:27:13Z")

</div>

Oh I missed the step `wazo-service restart`

If you still have the error, can you show us the output of:

```auto
apt-cache policy wazo-call-logd xivo-manage-db xivo-libdao-python3

```

edit: if these packages are not in the latest version, then a second `wazo-upgrade` should fix it. Otherwise, the complete wazo-upgrade log will be necessary

---

<div class="post-metadata">

**Author:** ![hiousi](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/hiousi/32/378_2.png) [@hiousi](https://wazo-platform.discourse.group/u/hiousi)\
**Post date:** [March 4, 2021, 9:02am UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/8 "2021-03-04T09:02:59Z")

</div>

> [@fblackburn](#):
>
> `apt-cache policy wazo-call-logd xivo-manage-db xivo-libdao-python3`

thanks, I’ve tried a wazo-service restart before answering and a full reboot to be sure.

```
~# apt-cache policy wazo-call-logd xivo-manage-db xivo-libdao-python3
wazo-call-logd:
  Installé : 21.02~20210210.181610.6b3079e.deb10
  Candidat : 21.02~20210210.181610.6b3079e.deb10
 Table de version :
 *** 21.02~20210210.181610.6b3079e.deb10 500
        500 http://mirror.wazo.community/debian pelican-buster/main amd64 Packages
        100 /var/lib/dpkg/status
xivo-manage-db:
  Installé : 21.02~20210210.174547.cbfc4dc.deb10
  Candidat : 21.02~20210210.174547.cbfc4dc.deb10
 Table de version :
 *** 21.02~20210210.174547.cbfc4dc.deb10 500
        500 http://mirror.wazo.community/debian pelican-buster/main amd64 Packages
        100 /var/lib/dpkg/status
xivo-libdao-python3:
  Installé : 21.02~20210210.171032.f139bd1.deb10
  Candidat : 21.02~20210210.171032.f139bd1.deb10
 Table de version :
 *** 21.02~20210210.171032.f139bd1.deb10 500
        500 http://mirror.wazo.community/debian pelican-buster/main amd64 Packages
        100 /var/lib/dpkg/status

```

---

<div class="post-metadata">

**Author:** ![fblackburn](https://avatars.discourse-cdn.com/v4/letter/f/51bf81/32.png) [@fblackburn](https://wazo-platform.discourse.group/u/fblackburn)\
**Post date:** [March 4, 2021, 12:52pm UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/9 "2021-03-04T12:52:44Z")

</div>

Well everything looks good to me 🤔  
Do you still have the error?

If so, what is the output of:

```sql
sudo -u postgres psql asterisk
> select * from alembic_version;
> \d call_log_participant

```

---

<div class="post-metadata">

**Author:** ![hiousi](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/hiousi/32/378_2.png) [@hiousi](https://wazo-platform.discourse.group/u/hiousi)\
**Post date:** [March 6, 2021, 7:39am UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/10 "2021-03-06T07:39:57Z")

</div>

> Do you still have the error?  
> argg yes.

```
asterisk=# select * from alembic_version;
 version_num  
--------------
 e5281e98b300
(1 row)

asterisk=# \d call_log_participant
                            Table "public.call_log_participant"
   Column | Type | Collation | Nullable | Default          
-------------+---------------------------+-----------+----------+---------------------------
 uuid | character varying(38) | | not null | 
 call_log_id | integer | | | 
 user_uuid | character varying(38) | | not null | 
 line_id | integer | | | 
 role | call_log_participant_role | | not null | 
 tags | character varying(128)[] | | not null | '{}'::character varying[]
Indexes:
    "call_log_participant_pkey" PRIMARY KEY, btree (uuid)
    "call_log_participant __idx__ user_uuid" btree (user_uuid)
Foreign-key constraints:
    "fk_call_log_id" FOREIGN KEY (call_log_id) REFERENCES call_log(id) ON DELETE CASCADE

```

---

<div class="post-metadata">

**Author:** ![fblackburn](https://avatars.discourse-cdn.com/v4/letter/f/51bf81/32.png) [@fblackburn](https://wazo-platform.discourse.group/u/fblackburn)\
**Post date:** [March 6, 2021, 1:19pm UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/11 "2021-03-06T13:19:39Z")

</div>

Did you remove `answered` column or change `version_num` value manually?  
I guess the answer is no, but it’s really weird because this revision add this column. The way to have this revision is because [this script](https://github.com/wazo-platform/xivo-manage-db/blob/master/alembic/versions/e5281e98b300_add_answered_column_to_cdr_participant.py) has been executed successfully, which will add the `answered` column.

Anyways, you can fix it by manually add the `answered` column

```auto
sudo -u postgres psql asterisk
> ALTER TABLE call_log_participant ADD COLUMN answered BOOLEAN NOT NULL DEFAULT 'false';

```

Just to be sure everything else is ok, can you show the output of:

```auto
> SELECT wazo_version FROM infos;

```

For the next upgrade, you can verify `wazo_version` value to be sure that script has been executed correctly. The version will be bumped to 20.03

---

<div class="post-metadata">

**Author:** ![hiousi](https://yyz2.discourse-cdn.com/free1/user_avatar/wazo-platform.discourse.group/hiousi/32/378_2.png) [@hiousi](https://wazo-platform.discourse.group/u/hiousi)\
**Post date:** [March 6, 2021, 1:37pm UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/12 "2021-03-06T13:37:42Z")

</div>

> [@fblackburn](#):
>
> `SELECT wazo_version FROM infos;`

thank you !  
it works now for wazo\_version, was 21.01, I just updated manually by doing a update infos set wazo\_version=‘21.02’; as I readed it in the alembic script.

What I understand is that database upgrade failed on wazo-upgrade because database was down.

---

<div class="post-metadata">

**Author:** ![fblackburn](https://avatars.discourse-cdn.com/v4/letter/f/51bf81/32.png) [@fblackburn](https://wazo-platform.discourse.group/u/fblackburn)\
**Post date:** [March 6, 2021, 1:43pm UTC](https://wazo-platform.discourse.group/t/error-column-answered/737/13 "2021-03-06T13:43:14Z")

</div>

> [@hiousi](#):
>
> it works now for wazo\_version, was 21.01, I just updated manually by doing a update infos set wazo\_version=‘21.02’; as I readed it in the alembic script.

That’s fine, the migration scripts were easy to redo manually 😛

> [@hiousi](#):
>
> What I understand is that database upgrade failed on wazo-upgrade because database was down.

In this case, the alembic `version_num` shouldn’t have been this version 🤔, but yeah, maybe a random behavior 🤷‍♂️  
Your are fine, but keep monitoring this for the next upgrade 😉
