Giter Site home page Giter Site logo

Issues running obooks about obooks HOT 11 CLOSED

MElhagaly avatar MElhagaly commented on June 15, 2024
Issues running obooks

from obooks.

Comments (11)

jenni avatar jenni commented on June 15, 2024

Hey @MustiDarsh thanks for reporting this! I've merged a fix to master, please pull and let me know if you bump into any other issue. Cheers!

from obooks.

MElhagaly avatar MElhagaly commented on June 15, 2024

Hi @jenni Thanks for the quick answer and fix. The above mentioned problem is (I think) fixed.

I am now receiving a timeout error:

 










          ::::::::  ::: :::::::::   ::::::::   ::::::::  :::    ::: :::::::: 
        :+:    :+: :+  :+:    :+: :+:    :+: :+:    :+: :+:   :+: :+:    :+: 
       +:+    +:+     +:+    +:+ +:+    +:+ +:+    +:+ +:+  +:+  +:+         
      +#+    +:+     +#++:++#+  +#+    +:+ +#+    +:+ +#++:++   +#++:++#++   
     +#+    +#+     +#+    +#+ +#+    +#+ +#+    +#+ +#+  +#+         +#+    
    #+#    #+#     #+#    #+# #+#    #+# #+#    #+# #+#   #+# #+#    #+#     
    ########      #########   ########   ########  ###    ### ########       













 
+:++:++:++:+      loging in... might take a while      +:++:++:++:+ 
(node:90630) UnhandledPromiseRejectionWarning: TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
    at /Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/LifecycleWatcher.js:142:21
  -- ASYNC --
    at Frame.<anonymous> (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/helper.js:111:15)
    at Page.waitForNavigation (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/Page.js:694:49)
    at Page.<anonymous> (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/helper.js:112:23)
    at GoogleAuthentication.login (/Users/MustiDarsh/Desktop/tmp/obooks/lib/authentication.js:94:20)
    at async GoogleAuthentication.authenticate (/Users/MustiDarsh/Desktop/tmp/obooks/lib/authentication.js:51:29)
    at async main (/Users/MustiDarsh/Desktop/tmp/obooks/cli.js:64:18)
(node:90630) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:90630) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Do you have any tips/advise on how to fix this error?

Note: I tried signing in using an account connected to Google and not using a gmail account.

from obooks.

jenni avatar jenni commented on June 15, 2024

@MustiDarsh it should work with accounts connected to google. It seems it's failing during google authentication - are you passing your gmail password in the -p flag?

You can always change this line: const browser = await puppeteer.launch({ headless: true }) to const browser = await puppeteer.launch({ headless: false }), then run the command and see in the browser exactly where it's failing, then get back here with the issue or even screenshot and I'll try to fix it.

from obooks.

MElhagaly avatar MElhagaly commented on June 15, 2024

@jenni changing the line to const browser = await puppeteer.launch({ headless: false })

Yes, I am using my gmail password in combination with the -p flag.

results in the follow:

 










          ::::::::  ::: :::::::::   ::::::::   ::::::::  :::    ::: :::::::: 
        :+:    :+: :+  :+:    :+: :+:    :+: :+:    :+: :+:   :+: :+:    :+: 
       +:+    +:+     +:+    +:+ +:+    +:+ +:+    +:+ +:+  +:+  +:+         
      +#+    +:+     +#++:++#+  +#+    +:+ +#+    +:+ +#++:++   +#++:++#++   
     +#+    +#+     +#+    +#+ +#+    +#+ +#+    +#+ +#+  +#+         +#+    
    #+#    #+#     #+#    #+# #+#    #+# #+#    #+# #+#   #+# #+#    #+#     
    ########      #########   ########   ########  ###    ### ########       













 
(node:70669) UnhandledPromiseRejectionWarning: Error: Protocol error (Page.navigate): Target closed.
    at /Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/Connection.js:183:56
    at new Promise (<anonymous>)
    at CDPSession.send (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/Connection.js:182:12)
    at navigate (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/FrameManager.js:118:39)
    at FrameManager.navigateFrame (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/FrameManager.js:95:7)
    at Frame.goto (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/FrameManager.js:406:37)
    at Frame.<anonymous> (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/helper.js:112:23)
    at Page.goto (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/Page.js:674:49)
    at Page.<anonymous> (/Users/MustiDarsh/Desktop/tmp/obooks/node_modules/puppeteer/lib/helper.js:112:23)
    at GoogleAuthentication.goToLoginPage (/Users/MustiDarsh/Desktop/tmp/obooks/lib/authentication.js:101:20)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async GoogleAuthentication.authenticate (/Users/MustiDarsh/Desktop/tmp/obooks/lib/authentication.js:50:27)
    at async main (/Users/MustiDarsh/Desktop/tmp/obooks/cli.js:64:18)
(node:70669) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:70669) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
MustiDarsh@MacBook-Pro obooks % 

What happens is: I see a Chromium window opening and just a few seconds later it closes abruptly.

Maybe worth mentioning is that I am using a Mac.

from obooks.

jenni avatar jenni commented on June 15, 2024

@MustiDarsh this is a different error from the previous you mentioned and seems to be related to puppeteer/puppeteer#1947 , are you getting it often or did you just try once?

from obooks.

MElhagaly avatar MElhagaly commented on June 15, 2024

@jenni it seems like it is related to the post issue attached. However, I am unable to find any .close() statements in your code. This suggests that I shouldn't expect the browser to ever close, but correct me if I am wrong.

from obooks.

MElhagaly avatar MElhagaly commented on June 15, 2024

@jenni I have tried it multiple times throughout the weekend, but unfortunately I still receive the error. Any ideas for a quick workaround or fix?

from obooks.

jenni avatar jenni commented on June 15, 2024

@MustiDarsh I'm not able to reproduce the issue. I'm using node v12.10.0. Maybe you can update the package.json file and change "puppeteer": "^2.1.1", run npm update and try again?

from obooks.

MElhagaly avatar MElhagaly commented on June 15, 2024

@jenni I believe the problem doesn't occur with the specified versions. I will test this out and get back to you.

from obooks.

jenni avatar jenni commented on June 15, 2024

@MustiDarsh I'm working on Dockerising the project to get rid of versioning issues, meanwhile I've deactivated the option to log in in favor of a -c <cookie> flag. This cookie can be grabbed from the Request Headers once logged in to OReilly. Hope it helps!

from obooks.

MElhagaly avatar MElhagaly commented on June 15, 2024

@jenni I have been testing it for a couple of weeks now. It is working perfectly with specified version.

Also, I find it a good idea dockerising the project. Let me know if I can help out.

from obooks.

Related Issues (18)

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.