Closed firm1 closed 8 years ago
Timer pas mis en place.
La mise en place de ce timer est documentée quelque part ? Parce que là tout ce qui est publié sort sans extra contents
Si on me donne les informations pour mettre ça en place ça sera fait de suite !
En toute bonne foi : là ? (scrollez un peu, c'est #3080 mais le lien cafouille)
(ok, c'est pas dans la doc d'instal, c'est mal, @artragis :p )
Pour le coup tout était OK sur le serveur, j'ai relancé le service. Quelqu'un peut republier le contenu ? @firm1 ?
Republier, peut-être pas ça pourrait mettre une version non désirée, mais tu peux au moins utiliser la génération de pdf. en faisant ceci (j'ai mis les id des contenus qui posent souci):
python manage.py generate_pdf id=1305,1167,963,1103,1114
Sauf si c'est possible de redéclencher la génération autrement.
J'ai trouvé, on a pas pandoc d'installé ! ping @SpaceFox
Heu, normalement si, en suivant la doc de la procédure d'install, ça m'a pris plus d'une heure…
2016-05-31 10:42 GMT+02:00 Laville Augustin notifications@github.com:
J'ai trouvé, on a pas pandoc d'installé ! ping @SpaceFox https://github.com/SpaceFox
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zestedesavoir/zds-site/issues/3631#issuecomment-222627315, or mute the thread https://github.com/notifications/unsubscribe/AFhKnLn0K310XHpBXhNlMBvAarqVIIjCks5qG_R1gaJpZM4IpB9O .
Les paquets Debian sont bien installés mais impossible de trouver des traces de pandoc (et d'une utilisation de cabal). Je vais essayer de réinstaller ça.
En fait pandoc est bien installé, je sais juste pas où :/ (je cherche)
Je n'ai pas utilisé le paquet Pandoc de Debian ! Je ne sais pas où l'a installé la procédure indiquée dans la doc. Et surtout IL NE FAUT PAS suivre cette procédure sur le serveur de prod pendant qu'il y a du monde dessus, c'est la mort assurée !
2016-05-31 11:04 GMT+02:00 Laville Augustin notifications@github.com:
En fait pandoc est bien installé, je sais juste pas où :/
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zestedesavoir/zds-site/issues/3631#issuecomment-222632154, or mute the thread https://github.com/notifications/unsubscribe/AFhKnHwS1iyarsWbEFB8xMo9eZPzFK-Dks5qG_mTgaJpZM4IpB9O .
T'inquiète pas @SpaceFox, je cherche juste où est le fichier binaire mais impossible de trouver où il est.
Si c'est la procédure suivie sur cette doc, c'est /usr/bin/pandoc
(vraiment). Ceci dit, je me doute que c'est pas aussi simple. J'ai aussi ~/.cabal/bin/pandoc
à proposer.
Malheureusement aucun des deux n'existe.
Une fois que tu auras trouvé le binaire de pandoc, si celui-ci n'est pas accessible dans le PATH, tu peux surcharger dans le settings_prod.py
ce paramètre pour renseigner le chemin complet de pandoc.
Je sais firm1, j'ai passé 30 minutes à le "nettoyer" ce matin ;)
et which pandoc ça marche pas?
2016-05-31 11:30 GMT+02:00 Laville Augustin notifications@github.com:
Je sais firm1, j'ai passé 30 minutes à le "nettoyer" ce matin ;)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zestedesavoir/zds-site/issues/3631#issuecomment-222638113, or mute the thread https://github.com/notifications/unsubscribe/ABc_xVzibjWbKdihaxFgCaiK32ms-WPpks5qG_-zgaJpZM4IpB9O .
Vu la gueule des pdf actuellement, c'est vraiment nécessaire ?
Tant qu'on a pas une autre solution, oui.
Bon alors, heure creuse j'en profite pour ré-installer pandoc globalement avec cabal update && sudo cabal install --global pandoc
. Tout s'est bien passé et rapidement (quelques minutes seulement). Le chemin a changé par rapport à l'ancien serveur donc je l'ai mis à jour dans le settings_prod.py
.
Je tente donc de regénérer ce qui ne l'avait pas été mais je me suis mangé encore des erreurs :
$ python manage.py generate_pdf id=1305,1167,963,1103,1114
Génération de PDF pour 5 contenus
pandoc: Could not find data file /usr/local/share/x86_64-linux-ghc-7.6.3/pandoc-1.17.0.3/data/templates/../../../assets/tex/template.tex
- controler-la-propagation-des-erreurs-de-calculs-numeriques [ERREUR]
pandoc: Could not find data file /usr/local/share/x86_64-linux-ghc-7.6.3/pandoc-1.17.0.3/data/templates/../../../assets/tex/template.tex
- la-definition-en-mathematiques [ERREUR]
pandoc: Could not find data file /usr/local/share/x86_64-linux-ghc-7.6.3/pandoc-1.17.0.3/data/templates/../../../assets/tex/template.tex
- comprendre-les-encodages [ERREUR]
pandoc: Could not find data file /usr/local/share/x86_64-linux-ghc-7.6.3/pandoc-1.17.0.3/data/templates/../../../assets/tex/template.tex
- zeste-de-savoir-passe-bientot-en-version-18 [ERREUR]
pandoc: Could not find data file /usr/local/share/x86_64-linux-ghc-7.6.3/pandoc-1.17.0.3/data/templates/../../../assets/tex/template.tex
- batterie-pile-et-autonomie-1 [ERREUR]
Bon, ce truc est en dur dans la commande https://github.com/zestedesavoir/zds-site/blob/97691b626292fcf45b45f0e08def0fa725ea0df2/zds/settings.py#L347 donc j'ai mis à jour la commande avec le bon fichier et ouvert une PR pour qu'on ajoute un paramètre propre sur le chemin : https://github.com/zestedesavoir/zds-site/issues/3646
On relance la génération des PDF. Quand ça veut pas, ça veut pas :
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
! fontspec error: "font-not-found"
!
! The font "Merriweather" cannot be found.
!
! See the fontspec documentation for further information.
!
! For immediate help type H <return>.
!...............................................
Grrrr ! Bon aller on cherche un peu et on installe ce qui va bien (cf https://github.com/zestedesavoir/zds-site/issues/3647).
J'ai toujours les mêmes erreurs et la police n'est pas dans fc-list
. Bref je sèche. Si quelqu'un a une idée je prends !
J'ai une "solution", mais c'est cochon: dixit n'importe quel log travis,
$ export RESOURCES_URL="http://www.googledrive.com/host/0BzabS14KitJgfmV2ekdWSktmVEpieU93TG11RFNkWlZqS0JwZk93ZGhMR1lCWVg5NzFVc00"
$ mkdir -p ~/.fonts/truetype
$ wget -P ~/.fonts/truetype $RESOURCES_URL/Andale-Mono.ttf
$ wget -P ~/.fonts/truetype $RESOURCES_URL/Merriweather.zip
$ unzip ~/.fonts/truetype/Merriweather.zip -d ~/.fonts/truetype/Merriweather/
$ chmod a+r ~/.fonts/truetype/Merriweather/*.ttf
$ chmod a+r ~/.fonts/truetype/Andale-Mono.ttf
$ fc-cache -f -v
Sinon, Andale Mono, je suis quasi certain qu'elle est dans ttf-mscorefonts-installer
(ou un truc du genre, bref, le paquet de fonts de 'crosoft). Quand à Merriweather, elle sont dispo là en truetype (parce que l'installer pour LaTeX n'a pas l'air de régler le problème, je soupçonne donc que pandoc s'attend à l'avoir comme une police "normale", ce con), et j'imagine qu'il faut la fourrer dans ~/.fonts/truetype/
(c'est ça ou aller la taper dans /usr/share/fonts/
ou /usr/local/share/fonts/
, et je préfère éviter d'aller tripoter là bas). Et on termine par fc-cache -f -v
?
J'y ai pensé mais j'ai trouvé ça assez sale et je comptais l'utiliser en dernière option.
D'ou le paragraphe du dessous ou je tente de contourner :p
J'avais pas vu cette issue.
c/c du MP envoyé à @gustavi il y a 5 minutes:
zds-watchdog était mort sur la prod, probablement depuis l'installation de la prod.
Il refusait de se lancer :
Jul 19 15:15:53 gandi systemd[1]: Starting Zeste de Savoir - Watchdog...
Jul 19 15:15:53 gandi systemd[1]: Started Zeste de Savoir - Watchdog.
Jul 19 15:15:53 gandi systemd[9640]: Failed at step CHDIR spawning /opt/zds/zdsenv/bin/python: No such file or directory
Jul 19 15:15:53 gandi systemd[1]: zds-watchdog.service: main process exited, code=exited, status=200/CHDIR
Jul 19 15:15:53 gandi systemd[9643]: Failed at step CHDIR spawning /bin/kill: No such file or directory
Jul 19 15:15:53 gandi systemd[1]: zds-watchdog.service: control process exited, code=exited status=200
Jul 19 15:15:53 gandi systemd[1]: Unit zds-watchdog.service entered failed state.
J'ai dû le modifier comme suit:
[Unit]
Description=Zeste de Savoir - Watchdog
After=network.target
[Service]
User=zds
Group=zds
-WorkingDirectory=/opt/zds/zdsenv/zds-site
+WorkingDirectory=/opt/zds/zds-site
ExecStart=/opt/zds/zdsenv/bin/python /opt/zds/zds-site/manage.py publication_watchdog
ExecStop=/bin/kill -s TERM $MAINPID
[Install]
WantedBy=multi-user.target
J'ai installé les fonts. Un script est là pour ça, /home/zds/install_fonts/
. A documenter.
J'ai aussi dû modifier le template latex en live sur la prod, ce qui est moche mais je peux pas tester autrement. Il y manquait une macro latex, problème connu de pandoc, et le chemin vers la coverpage n'était plus valide. J'ai suis en train de régénérer tous les PDFs, puis je vais annuler mes modifications de la prod pour qu'on n'ait pas de problème lors de la prochaine MEP.
diff --git a/assets/tex/template.tex b/assets/tex/template.tex
index 927cded..2a91773 100644
--- a/assets/tex/template.tex
+++ b/assets/tex/template.tex
@@ -39,6 +39,10 @@ $if(mathfont)$
\setmathfont(Digits,Latin,Greek){$mathfont$}
$endif$
\fi
+% tightlist macro: http://tex.stackexchange.com/a/258486
+\providecommand{\tightlist}{%
+ \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
+
% use microtype if available
\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
$if(geometry)$
@@ -155,7 +159,8 @@ $endfor$
\begin{document}
$if(title)$
-\ULCornerWallPaper{1}{../../../assets/tex/coverpage.pdf}
+\ULCornerWallPaper{1}{/opt/zds/zds-site/assets/tex/coverpage.pdf}
\maketitle
\ClearWallPaper
$endif$
Notez que je connais rien à pandoc et quasi rien à latex. Encore moins à notre architecture de génération de PDFs et autres epubs, à notre watchdog, à qu'est-ce qui se passe quand et qui trigger quoi. Si quelqu'un veut bien s'en occuper, ça m'arrange.
cc @artragis @gustavi @GerardPaligot @pierre-24
C'est @artragis le spécialiste: là, les PDFs sont effectivement générés ... Mais pas le reste ;) (epub et HTML)
EDIT: si on galère, c'est qu'on a oublié de le noter quelque part ou qu'on sais pas chercher.
alors comment que ça fonctionne :
Il y a trois modes possibles pour la génération des contenus :
Le watchdog se contente d'encapsuler le même processus que "au moment de la publication" mais dans une tâche de fond. La seule différence c'est que le site va simplement déposer un jeton dans un dossier spécial que le watchdog va détecter et il va créer le contenu à ce moment là.
Pour le reste c'est globalement : poru chaque format supporté factory.get_generator_for_format(current).generate()
2016-07-19 16:35 GMT+02:00 Pierre Beaujean notifications@github.com:
C'est @artragis https://github.com/artragis le spécialiste: là, les PDFs sont effectivement générés ... Mais pas le reste ;) (epub et HTML)
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zestedesavoir/zds-site/issues/3631#issuecomment-233652504, or mute the thread https://github.com/notifications/unsubscribe-auth/ABc_xYlE_fUhZa8rBLMeawtmcC_LqDkIks5qXOCkgaJpZM4IpB9O .
Ok @artragis. Du coup, il faut que le site dépose ce jeton, puis watchdog génère un type de contenu externe indiqué dans le jeton ? Genre par exemple : pour un contenu X, après validation on aura un token correspondant au contenu X, watchdog verra l'apparition du token, verra que le token demande la génération d'un PDF et d'un EPUB mais pas d'un HTML ? C'est ça ?
Si oui, y'a moyen de générer un token par contenu par type de format, histoire de tout régénérer ?
non, les formats générés sont mis "en dur" dans le code et ne sont surchargeable que dnas le settings.py
Le 19 juillet 2016 à 17:31, victor felder notifications@github.com a écrit :
Ok @artragis https://github.com/artragis. Du coup, il faut que le site dépose ce jeton, puis watchdog génère un type de contenu externe indiqué dans le jeton ? Genre par exemple : pour un contenu X, après validation on aura un token correspondant au contenu X, watchdog verra l'apparition du token, verra que le token demande la génération d'un PDF et d'un EPUB mais pas d'un HTML ? C'est ça ?
Si oui, y'a moyen de générer un token par contenu par type de format, histoire de tout régénérer ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zestedesavoir/zds-site/issues/3631#issuecomment-233670968, or mute the thread https://github.com/notifications/unsubscribe-auth/ABc_xdIS319svp3sug4lmAZfcmK8JhAfks5qXO3rgaJpZM4IpB9O .
Mince, j'étais convaincu qu'il y avait un moyen de forcer watchdog à repasser faire tout ce qui n'avait pas été fait pendant qu'il était pas là :/
Sur les derniers contenus c'est bien généré.
Je re-ouvre, parfois il y a le PDF, parfois non. Idem pour l'ePub.
Est-ce qu'on est vraiment sur la même issue ? Quand je lis le premier poste de @firm1 c'est réglé, je pense que le reste c'est principalement des erreur de compilation dans le format voulu.
Si tu fermes celle-ci, faut en ouvrir une autre. :)
Cette issue semble effectivement réglée. Elle concerne la génération des formats externes pour les nouveaux contenus.
Le fait que la génération échoue sur certains vieux contenus est un autre problème. @GerardPaligot peux-tu stp ouvrir une autre issue avec quelques exemples de contenus dont les formats externes sont manquants ? On pourra ainsi relancer la génération de ces contenus uniquement et y mettre la trace de l'échec de génération.
Depuis le passage sur le serveur gandi le 21/22 mai, toutes les publications (à commencé par cet article) n'ont ni de pdf, ni de epub, ni de html généré.
Etant donné que ça fonctionnait avant le switch de serveur, je vais attribuer ça à l'infra.