• United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.206

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

App ID-Webappstrategy redirection returning UnhandledPromiseRejectionWarning

060001EXUR gravatar image
Question by PushkarKale  (25) | Nov 14, 2018 at 09:05 AM ibm-cloudwatsonnode.jsappid

Hello, Following Node JS code is returning unhandled promise rejection warning :

app.get(LOGIN_URL, passport.authenticate(WebAppStrategy.STRATEGY_NAME, { successRedirect: LANDING_PAGE_URL, forceLogin: true }));

Snippet from logs :

[2018-11-14 19:14:20.913] [DEBUG] appid-webapp-strategy - handleAuthorization [2018-11-14 19:14:20.918] [DEBUG] appid-webapp-strategy - handleAuthorization :: redirecting to https://appid-oauth.eu-gb.bluemix.net/oauth/v3/XXXXXXXXXXXXXXXXXXXXX/authorization?client_id=XXXXXXXXXXXXX&response_type=code&redirect_uri=http://localhost:3009/ibm/bluemix/appid/callback≻ope=appid_default⟨uage=en-US&state=XXXXXXXXXXXXX (node:15188) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): (node:15188) [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. [2018-11-14 19:14:40.698] [DEBUG] appid-webapp-strategy - handleCallback

Please help.

Thanks! Pushkar

People who like this

  0
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

1 reply

  • Sort: 
060001FVFS gravatar image

Answer by NitzanNissim (1) | Nov 14, 2018 at 10:35 AM

Its hard to know from this where was the UnhandledPromiseRejectionWarning thrown from in your application. Can you please add this code:

 process.on('unhandledRejection', (reason, p) => {
       console.log('Unhandled Rejection at:', p, 'reason:', reason);
    } );

this will let us know what is the origin of the promise, and whether its App ID related.

Comment

People who like this

  0   Show 1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
060001EXUR gravatar image PushkarKale (25)   Nov 14, 2018 at 11:40 AM 0
Share

Hi,

Below is what i see after adding the above code :

[2018-11-14 22:00:31.031] [DEBUG] appid-webapp-strategy - handleAuthorization [2018-11-14 22:00:31.035] [DEBUG] appid-webapp-strategy - handleAuthorization :: redirecting to https://appid-oauth.eu-gb.bluemix.net/oauth/v3/XXXXXXXXXX/authorization?client_id=XXXXXXXXX&response_type=code&redirect_uri=http://localhost:3009/ibm/bluemix/appid/callback≻ope=appid_default⟨uage=en-US&state=XXXXXX Unhandled Rejection at: Promise { '' } reason:

Also, the promise rejection warning does not seem to be thrown from the application code but from some app id library because it is thrown even before redirection i.e. while loading the login page itself and there is no other code involved apart from the above app.get(LOGIN_URL)....

Thanks!

Follow this question

170 people are following this question.

Answers

Answers & comments

Related questions

I want to answer based on compose-mysql database but don't know how to do.. 1 Answer

what are the credentials to log into rank and retrieve? 4 Answers

Where can I find my correct Alchemy API Key? 1 Answer

Can Watson Assistant detect multiple intents? 3 Answers

Error while installing watson-developer-cloud Node package. 0 Answers

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • DataPower
  • Decision Optimization
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges