MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    MMM-GooglePhotos Unhandled promise rejection

    Scheduled Pinned Locked Moved Troubleshooting
    9 Posts 2 Posters 1.6k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S Offline
      sdetweil @velkrosmaak
      last edited by

      @velkrosmaak error 429
      https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      V 1 Reply Last reply Reply Quote 0
      • V Offline
        velkrosmaak @sdetweil
        last edited by

        @sdetweil ah heck, how did I miss that?! So I need to increase both of those intervals?

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          sdetweil @velkrosmaak
          last edited by

          @velkrosmaak seems so

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • V Offline
            velkrosmaak
            last edited by

            I’m still getting the same error with this.

            My interval values for testing are this at the moment:

             updateInterval: 20000*60, 
             scanInterval: 1000*60*60*4, 
            

            According to the Google API docs,

            The quota limit for requests to access media bytes (by loading a photo or video from a base URL) is 75,000 requests per project per day.
            

            https://developers.google.com/photos/library/guides/api-limits-quotas

            I’m well within that with those values, but am still getting 429s. When it did briefly work it was advancing through images very quickly which makes me think that one of those values is a rate rather than an interval. While i’m brute force guessing the config, is there anyone who’s got this working that can shed any light?

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @velkrosmaak
              last edited by sdetweil

              @velkrosmaak the default updateInterval is 30 seconds

              so, your config looks like this, right

              {     
                    module:"MMM-GooglePhotots",
                    position:"....",
                    config : { 
                       updateInterval:20000*60,
                      scanInterval: 1000*60*60*4, 
                   }
              }
              

              settings MUST be inside the config:{} block on every module

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • V Offline
                velkrosmaak
                last edited by

                @sdetweil That’s right, that’s how my config currently is. When it does work, other parameters such as date range, album and sort order are observed so I’m fairly confident it’s valid.

                The docs appear to have changed so I’ve removed ‘scaninterval’ and increased the updateInterval to ‘50000*60’. The problem sadly persists.

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @velkrosmaak
                  last edited by

                  @velkrosmaak the code in node_helper uses scanInterval

                  if not specified, OR less than 10 minutes
                  this.config.scanInterval < 1000 * 60 * 10
                  it is set to 10 minutes
                  this.config.scanInterval = 1000 * 60 * 10

                  add debug:true to the settings and look at the messages where us start mm…

                  npm start
                  or
                  pm2

                  if pm2, then pm2 logs --lines=100

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  V 1 Reply Last reply Reply Quote 0
                  • V Offline
                    velkrosmaak @sdetweil
                    last edited by

                    @sdetweil I’ve added ‘debug: true,’ inside the config block but I don’t seem to get any other errors regarding the MMM-GooglePhotos module (or any other errors at all in fact) apart from this one below. This is after restarting MM using pm2:

                    pm2 restart mm && pm2 logs --lines=100
                    

                    I’ve also tried it without limiting the lines and I just get this same 429 error over and over.

                    0|mm  | [23.04.2021 00:07.26.515] [ERROR]
                    0|mm  | (node:14901) UnhandledPromiseRejectionWarning: Error: Request failed with status code 429
                    0|mm  |     at createError (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/core/createError.js:16:15)
                    0|mm  |     at settle (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/core/settle.js:17:12)
                    0|mm  |     at IncomingMessage.handleStreamEnd (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/axios/lib/adapters/http.js:236:11)
                    0|mm  |     at IncomingMessage.emit (events.js:327:22)
                    0|mm  |     at endReadableNT (_stream_readable.js:1220:12)
                    0|mm  |     at processTicksAndRejections (internal/process/task_queues.js:84:21)
                    0|mm  | [23.04.2021 00:07.26.518] [ERROR]
                    0|mm  | (node:14901) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
                    0|mm  | [23.04.2021 00:07.26.521] [ERROR] (node:14901) [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.
                    

                    Thanks so much for the help by the way!

                    1 Reply Last reply Reply Quote -1
                    • 1 / 1
                    • First post
                      Last post
                    Enjoying MagicMirror? Please consider a donation!
                    MagicMirror created by Michael Teeuw.
                    Forum managed by Sam, technical setup by Karsten.
                    This forum is using NodeBB as its core | Contributors
                    Contact | Privacy Policy