Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Found #6

Closed
ssonnet opened this issue Oct 28, 2021 · 8 comments
Closed

Not Found #6

ssonnet opened this issue Oct 28, 2021 · 8 comments
Labels
bug Something isn't working

Comments

@ssonnet
Copy link

ssonnet commented Oct 28, 2021

Bonjour,
J'essaye de faire fonctionner votre plugin qui me renvoie une erreur 404 lorsque je demande la génération du PDF (la prévisualisation avec ?do=_pdfgen_view fonctionne). Lodel est installé sur une VM locale (virtualbox) et le système de conversion sur mon instance Docker Desktop (windows). Je vous mets le message d'erreur ci-dessous. Auriez-vous une idée du problème ?
Cordialement.

#0 LodelException::exception_handler(TheCodingMachine\Gotenberg\ClientException Object ([*message] => Not Found,[Exceptionstring] => ,[*code] => 404,[*file] => /var/www/html/lodel/share/plugins/custom/pdfgen/vendor/thecodingmachine/gotenberg-php-client/src/Client.php,[*line] => 106,[Exceptiontrace] => Array ([0] => Array ([file] => /var/www/html/lodel/share/plugins/custom/pdfgen/vendor/thecodingmachine/gotenberg-php-client/src/Client.php,[line] => 57,[function] => handleResponse,[class] => TheCodingMachine\Gotenberg\Client,[type] => ->,[args] => Array ([0] => GuzzleHttp\Psr7\Response Object ([GuzzleHttp\Psr7\ResponsereasonPhrase] => Not Found,[GuzzleHttp\Psr7\ResponsestatusCode] => 404,[GuzzleHttp\Psr7\Responseheaders] => Array ([Content-Length] => Array ([0] => 9),[Content-Type] => Array ([0] => text/plain; charset=UTF-8),[Date] => Array ([0] => Thu, 28 Oct 2021 10:01:01 GMT),[Gotenberg-Trace] => Array ([0] => da10a4c3-d5ae-4081-8d45-55824cf375e3)),[GuzzleHttp\Psr7\ResponseheaderNames] => Array ([content-length] => Content-Length,[content-type] => Content-Type,[date] => Date,[gotenberg-trace] => Gotenberg-Trace),[GuzzleHttp\Psr7\Responseprotocol] => 1.1,[GuzzleHttp\Psr7\Responsestream] => GuzzleHttp\Psr7\Stream Object ([GuzzleHttp\Psr7\Streamstream] => Resource id #56,[GuzzleHttp\Psr7\Streamsize] => ,[GuzzleHttp\Psr7\Streamseekable] => 1,[GuzzleHttp\Psr7\Streamreadable] => 1,[GuzzleHttp\Psr7\Streamwritable] => 1,[GuzzleHttp\Psr7\Streamuri] => php://temp,[GuzzleHttp\Psr7\StreamcustomMetadata] => Array ())))),[1] => Array ([file] => /var/www/html/lodel/share/plugins/custom/pdfgen/pdfgen.php,[line] => 68,[function] => store,[class] => TheCodingMachine\Gotenberg\Client,[type] => ->,[args] => Array ([0] => TheCodingMachine\Gotenberg\URLRequest Object ([TheCodingMachine\Gotenberg\URLRequestURL] => http://ara.local/lodel/sitenova/?do=_pdfgen_view&document=67&lang=fr&debug=,[TheCodingMachine\Gotenberg\ChromeRequestwaitDelay] => ,[TheCodingMachine\Gotenberg\ChromeRequestheader] => ,[TheCodingMachine\Gotenberg\ChromeRequestfooter] => ,[TheCodingMachine\Gotenberg\ChromeRequestpaperWidth] => 8.27,[TheCodingMachine\Gotenberg\ChromeRequestpaperHeight] => 11.7,[TheCodingMachine\Gotenberg\ChromeRequestmarginTop] => 0,[TheCodingMachine\Gotenberg\ChromeRequestmarginBottom] => 0,[TheCodingMachine\Gotenberg\ChromeRequestmarginLeft] => 0,[TheCodingMachine\Gotenberg\ChromeRequestmarginRight] => 0,[TheCodingMachine\Gotenberg\ChromeRequestlandscape] => ,[TheCodingMachine\Gotenberg\ChromeRequestpageRanges] => ,[TheCodingMachine\Gotenberg\ChromeRequestgoogleChromeRpccBufferSize] => ,[TheCodingMachine\Gotenberg\ChromeRequestscale] => ,[TheCodingMachine\Gotenberg\RequestresultFilename] => ,[TheCodingMachine\Gotenberg\RequestwaitTimeout] => ,[TheCodingMachine\Gotenberg\RequestwebhookURL] => ,[TheCodingMachine\Gotenberg\RequestwebhookURLTimeout] => ,[*customHTTPHeaders] => Array ()),[1] => /var/www/html/lodel/sitenova/CACHE/e71411a00aec7a755a33c6dc3f8547e9)),[2] => Array ([file] => /var/www/html/lodel/lodel/scripts/logic/class.mainplugins.php,[line] => 90,[function] => getAction,[class] => pdfgen,[type] => ->,[args] => Array ([0] => Array ([do] => pdfgen_get,[document] => 67,[lang] => fr,[id] => 0,[idgroup] => 0,[idclass] => 0,[idparent] => 0,[idtype] => 0,[identity] => 0,[version] => 1.0,[shareurl] => /lodel/share,[extensionscripts] => php,[currenturl] => http://ara.local/lodel/sitenova/?do=_pdfgen_get&document=67&lang=fr,[siteroot] => ,[sharedir] => .././share,[tableprefix] => ,[tp] => ,[base_rep] => Array (),[charset] => utf-8,[site] => sitenova,[db_charset] => utf8mb4,[siteinfos] => Array ([id] => 1,[title] => Site Nova,[subtitle] => ,[name] => sitenova,[path] => /sitenova,[url] => http://ara.local/lodel/sitenova,[langdef] => ,[lang] => ,[status] => 1,[upd] => 2021-10-27 14:38:13),[siteurl] => http://ara.local/lodel/sitenova,[options] => Array ([metadonneessite] => Array ([titresite] => Titresite,[soustitresite] => ,[titresiteabrege] => Titre abrégé du site,[descriptionsite] => ,[urldusite] => ,[issn] => ,[issn_electronique] => ,[editeur] => ,[adresseediteur] => ,[producteursite] => ,[diffuseursite] => ,[droitsauteur] => ,[directeurpublication] => ,[redacteurenchef] => ,[courrielwebmaster] => ,[courrielabuse] => ,[motsclesdusite] => ,[langueprincipale] => fr,[typepublication] => Revue,[pdf] => ,[pdf_electronique] => ,[imagehabillee] => ),[diffusionelectronique] => Array ([bouquetfreemium] => ,[librairieelectronique] => ,[prixcommercialisationnumero] => ),[optionsaffichage] => Array ([affichageindexannuel] => ,[affichageindexparlangue] => ,[affichageindexcr] => ,[affichageindexpersonnes] => First name Surname,[barrenavaffichagenumero] => per issue,[affichageremerciements] => top,[pub_level_accordion] => none,[firstlogo] => ,[math] => ,[hide_varia] => ),[optionsgenerales] => Array ([emversion] => 1.0.2)),[sitelang] => fr,[defaultlang] => Array ([AR] => العربية,[BS] => Bosanski jezik,[CS] => Česky,[DE] => Deutsch,[EL] => Ελληνικά,[EN] => English,[ES] => Español,[ET] => Eesti keel,[EU] => Euskara,[FA] => ‫فارسی,[FI] => Suomen kieli,[FR] => Français,[GA] => Gaeilge,[HR] => Hrvatski,[HU] => Magyar,[IT] => Italiano,[HE] => ‫עברית,[JA] => 日本語,[KV] => коми кыв,[LA] => Latine,[LV] => Latviešu valoda,[MK] => македонски јазик,[NL] => Nederlands,[OC] => Occitan,[PL] => Polski,[PT] => Português,[RU] => Русский язык,[SL] => Slovenščina,[SR] => српски језик,[SV] => Svenska,[TR] => Türkçe,[ZH] => 中文),[installlang] => fr,[login] => ssonnet,[lodeluser] => Array ([rights] => 128,[lang] => fr,[id] => 2,[gui_complexity] => 64,[name] => ssonnet,[groups] => ,[desk] => 1,[restricted_user] => 1,[adminlodel] => 1,[admin] => 1,[editor] => 1,[redactor] => 1,[visitor] => 1,[idsession] => ,[session] => ),[clearcacheurl] => /lodel/sitenova/?do=_pdfgen_get&document=67&lang=fr&clearcache=oui,[lo] => plugins,[error] => Array (),[triggers] => Array ([0] => preview,[1] => postview,[2] => preedit,[3] => postedit,[4] => prelogin,[5] => postlogin,[6] => preauth,[7] => postauth)),[1] => Array ())),[3] => Array ([file] => /var/www/html/lodel/lodel/scripts/controller.php,[line] => 543,[function] => factory,[class] => MainPluginsLogic,[type] => ->,[args] => Array ([0] => Array ([do] => pdfgen_get,[document] => 67,[lang] => fr,[id] => 0,[idgroup] => 0,[idclass] => 0,[idparent] => 0,[idtype] => 0,[identity] => 0,[version] => 1.0,[shareurl] => /lodel/share,[extensionscripts] => php,[currenturl] => http://ara.local/lodel/sitenova/?do=_pdfgen_get&document=67&lang=fr,[siteroot] => ,[sharedir] => .././share,[tableprefix] => ,[tp] => ,[base_rep] => Array (),[charset] => utf-8,[site] => sitenova,[db_charset] => utf8mb4,[siteinfos] => Array ([id] => 1,[title] => Site Nova,[subtitle] => ,[name] => sitenova,[path] => /sitenova,[url] => http://ara.local/lodel/sitenova,[langdef] => ,[lang] => ,[status] => 1,[upd] => 2021-10-27 14:38:13),[siteurl] => http://ara.local/lodel/sitenova,[options] => Array ([metadonneessite] => Array ([titresite] => Titresite,[soustitresite] => ,[titresiteabrege] => Titre abrégé du site,[descriptionsite] => ,[urldusite] => ,[issn] => ,[issn_electronique] => ,[editeur] => ,[adresseediteur] => ,[producteursite] => ,[diffuseursite] => ,[droitsauteur] => ,[directeurpublication] => ,[redacteurenchef] => ,[courrielwebmaster] => ,[courrielabuse] => ,[motsclesdusite] => ,[langueprincipale] => fr,[typepublication] => Revue,[pdf] => ,[pdf_electronique] => ,[imagehabillee] => ),[diffusionelectronique] => Array ([bouquetfreemium] => ,[librairieelectronique] => ,[prixcommercialisationnumero] => ),[optionsaffichage] => Array ([affichageindexannuel] => ,[affichageindexparlangue] => ,[affichageindexcr] => ,[affichageindexpersonnes] => First name Surname,[barrenavaffichagenumero] => per issue,[affichageremerciements] => top,[pub_level_accordion] => none,[firstlogo] => ,[math] => ,[hide_varia] => ),[optionsgenerales] => Array ([emversion] => 1.0.2)),[sitelang] => fr,[defaultlang] => Array ([AR] => العربية,[BS] => Bosanski jezik,[CS] => Česky,[DE] => Deutsch,[EL] => Ελληνικά,[EN] => English,[ES] => Español,[ET] => Eesti keel,[EU] => Euskara,[FA] => ‫فارسی,[FI] => Suomen kieli,[FR] => Français,[GA] => Gaeilge,[HR] => Hrvatski,[HU] => Magyar,[IT] => Italiano,[HE] => ‫עברית,[JA] => 日本語,[KV] => коми кыв,[LA] => Latine,[LV] => Latviešu valoda,[MK] => македонски јазик,[NL] => Nederlands,[OC] => Occitan,[PL] => Polski,[PT] => Português,[RU] => Русский язык,[SL] => Slovenščina,[SR] => српски језик,[SV] => Svenska,[TR] => Türkçe,[ZH] => 中文),[installlang] => fr,[login] => ssonnet,[lodeluser] => Array ([rights] => 128,[lang] => fr,[id] => 2,[gui_complexity] => 64,[name] => ssonnet,[groups] => ,[desk] => 1,[restricted_user] => 1,[adminlodel] => 1,[admin] => 1,[editor] => 1,[redactor] => 1,[visitor] => 1,[idsession] => ,[session] => ),[clearcacheurl] => /lodel/sitenova/?do=_pdfgen_get&document=67&lang=fr&clearcache=oui,[lo] => plugins,[error] => Array (),[triggers] => Array ([0] => preview,[1] => postview,[2] => preedit,[3] => postedit,[4] => prelogin,[5] => postlogin,[6] => preauth,[7] => postauth)),[1] => Array (),[2] => Array ([0] => pdfgen,[1] => getAction))),[4] => Array ([file] => /var/www/html/lodel/lodel/scripts/controller.php,[line] => 133,[function] => _execute,[class] => Controller,[type] => ->,[args] => Array ([0] => Array ([do] => pdfgen_get,[document] => 67,[lang] => fr,[id] => 0,[idgroup] => 0,[idclass] => 0,[idparent] => 0,[idtype] => 0,[identity] => 0,[version] => 1.0,[shareurl] => /lodel/share,[extensionscripts] => php,[currenturl] => http://ara.local/lodel/sitenova/?do=_pdfgen_get&document=67&lang=fr,[siteroot] => ,[sharedir] => .././share,[tableprefix] => ,[tp] => ,[base_rep] => Array (),[charset] => utf-8,[site] => sitenova,[db_charset] => utf8mb4,[siteinfos] => Array ([id] => 1,[title] => Site Nova,[subtitle] => ,[name] => sitenova,[path] => /sitenova,[url] => http://ara.local/lodel/sitenova,[langdef] => ,[lang] => ,[status] => 1,[upd] => 2021-10-27 14:38:13),[siteurl] => http://ara.local/lodel/sitenova,[options] => Array ([metadonneessite] => Array ([titresite] => Titresite,[soustitresite] => ,[titresiteabrege] => Titre abrégé du site,[descriptionsite] => ,[urldusite] => ,[issn] => ,[issn_electronique] => ,[editeur] => ,[adresseediteur] => ,[producteursite] => ,[diffuseursite] => ,[droitsauteur] => ,[directeurpublication] => ,[redacteurenchef] => ,[courrielwebmaster] => ,[courrielabuse] => ,[motsclesdusite] => ,[langueprincipale] => fr,[typepublication] => Revue,[pdf] => ,[pdf_electronique] => ,[imagehabillee] => ),[diffusionelectronique] => Array ([bouquetfreemium] => ,[librairieelectronique] => ,[prixcommercialisationnumero] => ),[optionsaffichage] => Array ([affichageindexannuel] => ,[affichageindexparlangue] => ,[affichageindexcr] => ,[affichageindexpersonnes] => First name Surname,[barrenavaffichagenumero] => per issue,[affichageremerciements] => top,[pub_level_accordion] => none,[firstlogo] => ,[math] => ,[hide_varia] => ),[optionsgenerales] => Array ([emversion] => 1.0.2)),[sitelang] => fr,[defaultlang] => Array ([AR] => العربية,[BS] => Bosanski jezik,[CS] => Česky,[DE] => Deutsch,[EL] => Ελληνικά,[EN] => English,[ES] => Español,[ET] => Eesti keel,[EU] => Euskara,[FA] => ‫فارسی,[FI] => Suomen kieli,[FR] => Français,[GA] => Gaeilge,[HR] => Hrvatski,[HU] => Magyar,[IT] => Italiano,[HE] => ‫עברית,[JA] => 日本語,[KV] => коми кыв,[LA] => Latine,[LV] => Latviešu valoda,[MK] => македонски јазик,[NL] => Nederlands,[OC] => Occitan,[PL] => Polski,[PT] => Português,[RU] => Русский язык,[SL] => Slovenščina,[SR] => српски језик,[SV] => Svenska,[TR] => Türkçe,[ZH] => 中文),[installlang] => fr,[login] => ssonnet,[lodeluser] => Array ([rights] => 128,[lang] => fr,[id] => 2,[gui_complexity] => 64,[name] => ssonnet,[groups] => ,[desk] => 1,[restricted_user] => 1,[adminlodel] => 1,[admin] => 1,[editor] => 1,[redactor] => 1,[visitor] => 1,[idsession] => ,[session] => ),[clearcacheurl] => /lodel/sitenova/?do=_pdfgen_get&document=67&lang=fr&clearcache=oui,[lo] => plugins,[error] => Array (),[triggers] => Array ([0] => preview,[1] => postview,[2] => preedit,[3] => postedit,[4] => prelogin,[5] => postlogin,[6] => preauth,[7] => postauth)),[1] => pdfgen_getAction,[2] => plugins,[3] => Array ([0] => plugins),[4] => Array ())),[5] => Array ([file] => /var/www/html/lodel/lodel/src/index.php,[line] => 94,[function] => execute,[class] => Controller,[type] => ->,[args] => Array ([0] => Array ([0] => plugins),[1] => plugins))),[Exceptionprevious] => ))

@nahuelange
Copy link
Contributor

Bonjour,

PHP (lodel) n'arrive pas à accéder au service Gotenberg, vérifier l'URL du service dans les settings du plugin, et testez avec et sans le / final de l'URL.

@ssonnet
Copy link
Author

ssonnet commented Oct 28, 2021

L'url dans les settings du plugin est : http://admin:password@172.19.176.178:90
Dans les logs du container gotenberg, j'ai :

{"level":"error","ts":1635420768.4117725,"logger":"api","msg":"code=404, message=Not Found","trace":"52ebec0d-878d-4850-9860-5d76f8be94a9","remote_ip":"172.18.0.1","host":"gotenberg:3000","uri":"/convert/url","method":"POST","path":"/convert/url","referer":"","user_agent":"GuzzleHttp/6.5.5 curl/7.64.0 PHP/7.3.31-1~deb10u1","status":404,"latency":32800,"latency_human":"32.8µs","bytes_in":1060,"bytes_out":9}

Si je rajoute un slash : le code de l'exception passe de 404 à 301 et je n'ai plus de log au niveau du container.
Si je fais un curl -v http://admin:password@172.19.176.178:90/health depuis ma VM j'ai bien une réponse "status: up".
De tout ça je déduis que le service gotenberg est bien opérationnel, que ma VM parvient à l'interroger et que l'url du service tout en haut est bonne ?

@nahuelange
Copy link
Contributor

Dans ce cas, c'est Gotenberg qui n'arrive pas à accéder à l'install lodel. Est-ce que l'URL du site est bien définie dans lodeladmin ?

@ssonnet
Copy link
Author

ssonnet commented Oct 28, 2021

Oui elle est bien définie. Elle ne l'était pas dans les options du site, du coup dans le doute je l'ai rajoutée à cet endroit mais ça ne change rien.

@ssonnet
Copy link
Author

ssonnet commented Oct 28, 2021

Je viens de changer de configuration pour voir : j'ai lancé uniquement le container gotenberg sur le port 3000 (sans passer par le proxy intermédiaire). Pas plus de succès.
Par contre si je fais :

curl --request POST 'http://172.19.176.178:3000/forms/chromium/convert/url' --form 'url="https://my.url"' --form 'landscape="true"' --form 'marginTop="1"' --form 'marginBottom="1"' -o my.pdf

J'obtiens bien le pdf et dans les logs gotenberg j'ai :

2021/10/28 12:16:14.751 INFO api request handled {"trace": "5c396ab5-4ec4-40f1-acc5-deccc036f502", "remote_ip": "172.17.0.1", "host": "172.19.176.178:3000", "uri": "/forms/chromium/convert/url", "method": "POST", "path": "/forms/chromium/convert/url", "referer": "", "user_agent": "curl/7.64.0", "status": 200, "latency": 2308425500, "latency_human": "2.3084255s", "bytes_in": 455, "bytes_out": 907}

L'uri fournie par le plugin lodel n'est pas la même : "/convert/url" (interrogation depuis lodel) vs "/forms/chromium/convert/url" (le test ci-dessus). C'est normal ?

@ssonnet
Copy link
Author

ssonnet commented Oct 28, 2021

Bon, j'ai compris d'où vient le problème : votre plugin est basé sur la version 6 de gotenberg (https://gotenberg.dev/docs/6.x/url) et l'api ayant évolué, mais pas votre plugin, ce dernier n'est pas compatible avec la version 7 actuelle de gotenberg. J'ai installé la 6 et je parviens désormais à générer les pdf depuis lodel avec votre plugin.
Peut être serait-il bon de le signaler dans votre doc d'install (au passage rajouter également qu'il faut faire un composer install...) et modifier votre docker-compose.yml ?
Cordialement.

@nahuelange
Copy link
Contributor

En effet oui, j'ai oublié de fixer la version de l'image docker.

N'hésite pas à faire une PR, sinon je m'en occuperai quand j'aurai le temps.

@brrd brrd added the bug Something isn't working label Feb 24, 2022
@brrd brrd closed this as completed in 3cd867e May 22, 2023
@brrd
Copy link
Member

brrd commented May 22, 2023

J'ai verrouillé sur la version 6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants