Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
howto.doc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Documentations
howto.doc
Commits
e2fc772f
Commit
e2fc772f
authored
4 years ago
by
ines mkacher
Browse files
Options
Downloads
Patches
Plain Diff
Update bddcheck.md
parent
7669cf79
No related branches found
No related tags found
2 merge requests
!14
Mise à jour arborescence
,
!13
1.0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
troubleshooting/bddcheck.md
+10
-88
10 additions, 88 deletions
troubleshooting/bddcheck.md
with
10 additions
and
88 deletions
troubleshooting/bddcheck.md
+
10
−
88
View file @
e2fc772f
...
...
@@ -43,6 +43,7 @@ ou
ou
Aller dans le repertoire :
```
postgres
§ /usr/lib/postgresql# ls -ltr
total 4
...
...
@@ -86,16 +87,6 @@ psql -U user database < name_file.sql
## Requêtes utiles
### Trouver les mails non envoyés
```
psql
=# select alt_identifier from mlb_coll_ext where res_id in (select DISTINCT CAST(document->>'id' as int)
from emails where status = 'ERROR' and document->>'id' is not null);
```
```
psql
select fulltext_result FROM res_letterbox where fulltex_result is not null
```
### Rechercher tous les courriers (les plus récents)
...
...
@@ -114,25 +105,21 @@ ou
$ select * from res_letterbox where dest_user = ''le_id_de_l'utilisateur';
```
###
Rechercher un user et le remplacer
###
Trouver les mails non envoyés
```
psql
$ update res_letterbox set dest_user = 'levillain' where dest_user = 'GUE';
=# select alt_identifier from mlb_coll_ext where res_id in (select DISTINCT CAST(document->>'id' as int)
from emails where status = 'ERROR' and document->>'id' is not null);
```
ou
```
psql
$ update listinstance set item_id = 'levillain' where item_id = 'GUE';
select fulltext_result FROM res_letterbox where fulltex_result is not null
```
ou
```
psql
$ select * from users where firstname ilike '%lanie%';
```
ou
### Rechercher un user
```
psql
$
update users set status = 'DEL' where user_id = 'FERREIRA
';
$
select * from users where firstname ilike '%lanie%
';
```
### Rechercher les notifications de mail
...
...
@@ -141,29 +128,16 @@ $ update users set status = 'DEL' where user_id = 'FERREIRA';
$ select * from notif_email_stack;
```
### Supprimer les dates d'execution pour pouvoir relancer les notifications
Afficher uniquement les informations utiles et en ordre descendant
```
psql
$ update notif_email_stack set
exec_date
=NULL
, exec_result
=''
;
select email_stack_sid, recipient, subject,
exec_date, exec_result
from notif_email_stack order by exec_date desc
;
```
### Remettre un utilisateur supprimé (de manière logique en actif)
Changer le statut d'un utilisateur via la BDD
Au statut OK
```
psql
$ UPDATE public.users SET status='OK' WHERE user_id='bblier';
```
Au statut absent
```
psql
$ UPDATE public.users SET status='ABS' WHERE user_id='bblier'
;
maarch=# select * from notif_email_stack order by email_stack_sid desc limit 5
;
```
## Erreurs connues "Database connection failed"
Lors de la connection sur l'application vous avez ce message d'erreur :
...
...
@@ -362,59 +336,7 @@ service apache2 status
```
## Commandes pour diagnostic des notifications de mails
```
maarch=# update notif_email_stack set exec_result = '' where email_stack_sid = 14158;
UPDATE 1
maarch=# update notif_email_stack set exec_date = null where email_stack_sid = 14158;
UPDATE 1
maarch=# select * from notif_email_stack order by email_stack_sid desc limit 5;
maarch=# update notif_email_stack set recipient = 'melissa.olive@maarchlesbains.fr' where email_stack_sid = 14158;
UPDATE 1
maarch=# update notif_email_stack set exec_date = null where email_stack_sid = 14158;
UPDATE 1
maarch=# update notif_email_stack set exec_result = '' where email_stack_sid = 14158;
UPDATE 1
maarch=# \q
```
```
maarch=# select * from notif_email_stack order by email_stack_sid desc limit 5;
maarch=# update notif_email_stack set exec_result = '' where email_stack_sid = 14158;
UPDATE 1
maarch=# update notif_email_stack set exec_date = null where email_stack_sid = 14158;
UPDATE 1
maarch=# update notif_email_stack set recipient = 'martine.trani@ville-agde.fr' where email_stack_sid = 14158;
UPDATE 1
maarch=# \q
```
```
maarch=# update notif_email_stack set exec_date = null where email_stack_sid = 14158;
UPDATE 1
maarch=# update notif_email_stack set exec_result = '' where email_stack_sid = 14158;
UPDATE 1
maarch=# update notif_email_stack set recipient = 'paul.bringe@maarchlesbains.fr' where email_stack_sid = 14158;
UPDATE 1
maarch=# select * from notif_email_stack order by email_stack_sid desc limit 5;
maarch=# \q
```
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment