Giter VIP home page Giter VIP logo

Comments (16)

jajm avatar jajm commented on July 30, 2024

Do you have any error message on the Pikitia side ?

from urungi.

oliviercrouzet avatar oliviercrouzet commented on July 30, 2024

I have some warnings when I launch pikitia :

Listening on port: 3000
(node:29303) Warning: Accessing non-existent property 'count' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:29303) Warning: Accessing non-existent property 'findOne' of module exports inside circular dependency
(node:29303) Warning: Accessing non-existent property 'remove' of module exports inside circular dependency
(node:29303) Warning: Accessing non-existent property 'updateOne' of module exports inside circular dependency
Connected to mongodb://localhost/pikitia_development

and when I try to export to pdf, only this line that mentions the POST request :
::ffff:127.0.0.1 bacrungi POST /pikitia/oauth/token HTTP/1.0 404 159 - 3.125 ms

from urungi.

jajm avatar jajm commented on July 30, 2024

and when I try to export to pdf, only this line that mentions the POST request :
::ffff:127.0.0.1 bacrungi POST /pikitia/oauth/token HTTP/1.0 404 159 - 3.125 ms

That's the problem, pikitia itself should only see a request to /oauth/token not /pikitia/oauth/token
Try adding a trailing slash in your nginx configuration, like this: location /pikitia/ {

from urungi.

oliviercrouzet avatar oliviercrouzet commented on July 30, 2024

I already tried to add slash but that makes no difference. same errors urungi side and same pikitia site :
::ffff:127.0.0.1 bacrungi POST /pikitia/oauth/token HTTP/1.0 404 159 - 3.125 ms.

from urungi.

jajm avatar jajm commented on July 30, 2024

Have you tried to add a trailing slash to the proxy_pass argument too ? I don't remember exactly how, but nginx behaviour differs when you add these slashes

from urungi.

oliviercrouzet avatar oliviercrouzet commented on July 30, 2024

Yes I did this too and had no success. The path displayed in first line seems to match the expected path (/oauth/token) you told me about but the following lines speak now about invalid client ?!! :

::ffff:127.0.0.1 bacrungi POST /oauth/token HTTP/1.0 401 1402 - 84.820 ms

invalid_client: Invalid client: client is invalid
    at new InvalidClientError (/home/koha/pikitia/node_modules/oauth2-server/lib/errors/invalid-client-error.js:26:14)
    at /home/koha/pikitia/node_modules/oauth2-server/lib/handlers/token-handler.js:159:15
    at tryCatcher (/home/koha/pikitia/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/koha/pikitia/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/home/koha/pikitia/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/home/koha/pikitia/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/home/koha/pikitia/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/home/koha/pikitia/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/home/koha/pikitia/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues [as _onImmediate] (/home/koha/pikitia/node_modules/bluebird/js/release/async.js:17:14)
    at processImmediate (node:internal/timers:466:21)

As I had an underscore in my client_secret, I suspected a problem of forbidden character and replace it by a letter but uselessly.
Is there any constraint about client_secret format ?
I add I have inserted the client_id-client_secret pair in mongo prompt as explained in the API section of Pikitia Readme.

from urungi.

jajm avatar jajm commented on July 30, 2024

Are you sure you added the client to the right MongoDB database (pikitia_development) ?

There is no constraint on client_id/client_secret format, but just in case, use exclusively ASCII characters to avoid encoding issues.

from urungi.

oliviercrouzet avatar oliviercrouzet commented on July 30, 2024

Relevant question, that's the point. Pfff, I added it nowhere... I rerun the insert command after running use pikitia_development : that's better. The authenticate step seems to be passed, Hope is growing. but a new type of error sadly displays on pikitia side :

Connected to mongodb://localhost/pikitia_development
::ffff:127.0.0.1 bacrungi POST /oauth/token HTTP/1.0 200 99 - 124.836 ms
::ffff:127.0.0.1 - POST /pdf HTTP/1.0 500 3334 - 1379.558 ms
Error: Failed to launch the browser process!
[0620/172046.734195:FATAL:zygote_host_impl_linux.cc(116)] No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.
#0 0x55f87d8be739 base::debug::CollectStackTrace()
#1 0x55f87d82ed63 base::debug::StackTrace::StackTrace()
#2 0x55f87d8404f5 logging::LogMessage::~LogMessage()
#3 0x55f87ed5b74e service_manager::ZygoteHostImpl::Init()
#4 0x55f87d7e8837 content::ContentMainRunnerImpl::Initialize()
#5 0x55f87ed6280a service_manager::Main()
#6 0x55f87d7e1cf1 content::ContentMain()
#7 0x55f87d82b055 headless::(anonymous namespace)::RunContentMain()
#8 0x55f87d82ad1d headless::HeadlessShellMain()
#9 0x7fcecd5f82e1 __libc_start_main
#10 0x55f87b9f496a _start

Received signal 6
#0 0x55f87d8be739 base::debug::CollectStackTrace()
#1 0x55f87d82ed63 base::debug::StackTrace::StackTrace()
#2 0x55f87d8be2e0 base::debug::(anonymous namespace)::StackDumpSignalHandler()
#3 0x7fced23780e0 (/lib/x86_64-linux-gnu/libpthread-2.24.so+0x110df)
#4 0x7fcecd60afff gsignal
#5 0x7fcecd60c42a abort
#6 0x55f87d8bd235 base::debug::BreakDebugger()
#7 0x55f87d840994 logging::LogMessage::~LogMessage()
#8 0x55f87ed5b74e service_manager::ZygoteHostImpl::Init()
#9 0x55f87d7e8837 content::ContentMainRunnerImpl::Initialize()
#10 0x55f87ed6280a service_manager::Main()
#11 0x55f87d7e1cf1 content::ContentMain()
#12 0x55f87d82b055 headless::(anonymous namespace)::RunContentMain()
#13 0x55f87d82ad1d headless::HeadlessShellMain()
#14 0x7fcecd5f82e1 __libc_start_main
#15 0x55f87b9f496a _start
  r8: 0000000000000000  r9: 00007ffd942d70f0 r10: 0000000000000008 r11: 0000000000000246
 r12: 00007ffd942d83a8 r13: 00007ffd942d7380 r14: 00007ffd942d83b0 r15: aaaaaaaaaaaaaaaa
  di: 0000000000000002  si: 00007ffd942d70f0  bp: 00007ffd942d7330  bx: 0000000000000006
  dx: 0000000000000000  ax: 0000000000000000  cx: 00007fcecd60afff  sp: 00007ffd942d7168
  ip: 00007fcecd60afff efl: 0000000000000246 cgf: 002b000000000033 erf: 0000000000000000
 trp: 0000000000000000 msk: 0000000000000000 cr2: 0000000000000000
[end of stack trace]
Calling _exit(1). Core file will not be generated.


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/master/docs/troubleshooting.md

    at onClose (/home/koha/pikitia/node_modules/puppeteer/lib/Launcher.js:615:20)
    at Interface.<anonymous> (/home/koha/pikitia/node_modules/puppeteer/lib/Launcher.js:605:56)
    at Interface.emit (node:events:539:35)
    at Interface.close (node:readline:586:8)
    at Socket.onend (node:readline:277:10)
    at Socket.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
 

from urungi.

jajm avatar jajm commented on July 30, 2024

Please verify that you followed all instructions at https://github.com/biblibre/pikitia#installation and https://github.com/biblibre/pikitia#chromium-headless-shell-dependencies to install the headless browser needed to take screenshots

from urungi.

oliviercrouzet avatar oliviercrouzet commented on July 30, 2024

Yes I followed these instructions and added one or two libraires that were missing.
I have nothing returned now when I run the following command :
ldd node_modules/puppeteer/.local-chromium/linux-737027/chrome-linux/headless_shell | grep not

from urungi.

oliviercrouzet avatar oliviercrouzet commented on July 30, 2024

the OS is Debian stretch

from urungi.

jajm avatar jajm commented on July 30, 2024

Now that you added the missing dependencies, does it work ?

from urungi.

oliviercrouzet avatar oliviercrouzet commented on July 30, 2024

No, I had already added the needed dependancies (according to the pikitia instructions) before getting the last error lines i mentionned

from urungi.

jajm avatar jajm commented on July 30, 2024

Ok, so maybe you need to update your kernel, as advised by this message:

No usable sandbox! Update your kernel or see https://chromium.googlesource.com/chromium/src/+/master/docs/linux/suid_sandbox_development.md for more information on developing with the SUID sandbox. If you want to live dangerously and need an immediate workaround, you can try using --no-sandbox.

On my dev machine Pikitia runs well on Debian buster with Linux 5.10

from urungi.

oliviercrouzet avatar oliviercrouzet commented on July 30, 2024

I followed below instructions and that's ok for the sandbox problem now.
https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#alternative-setup-setuid-sandbox

Unfortunately, if the pdf is produced now, it 's empty (with a "404 Not Found" title). Suppose the path of source is not correct (cause of redirection ?)

from urungi.

oliviercrouzet avatar oliviercrouzet commented on July 30, 2024

Ok I got it. The url in my config/development.js was not correct :
module.exports = {
url: 'http://localhost',
ip: '0.0.0.0',
port: 8083,
db: 'mongodb://localhost:27017/urungi_development',
};
I put instead the url of the koha instance :
module.exports = {
url: 'https://[kohahost]:8080',
ip: '0.0.0.0',
port: 8083,
db: 'mongodb://localhost:27017/urungi_development',
};

Many thanks for your patient help.

from urungi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.