amplify-js: Endpoints are not getting updated in aws pinpoints and getting error - AWSPinpointProvider - updateEndpoint failed TypeError: Cannot read property 'byteLength' of undefined.

Before opening, please confirm:

JavaScript Framework

React Native

Amplify APIs

Analytics, Push Notifications

Amplify Categories

analytics, notifications

Environment information

System:
    OS: macOS 10.15.7
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Memory: 96.22 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.10.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
  Browsers:
    Chrome: 84.0.4147.135
    Safari: 13.1.3
  npmPackages:
    @aws-amplify/core: ^4.0.3 => 4.0.3
    @aws-amplify/pushnotification: ^4.0.3 => 4.0.3
    @babel/core: ^7.11.0 => 7.13.15
    @babel/runtime: ^7.11.0 => 7.12.5 (7.14.0)
    @react-native-async-storage/async-storage: ^1.15.4 => 1.15.4
    @react-native-community/clipboard: ^1.2.3 => 1.5.1
    @react-native-community/datetimepicker: ^3.4.7 => 3.4.7
    @react-native-community/eslint-config: ^2.0.0 => 2.0.0
    @react-native-community/masked-view: ^0.1.10 => 0.1.10
    @react-native-community/netinfo: ^5.9.7 => 5.9.10
    @react-native-community/push-notification-ios: ^1.8.0 => 1.8.0 (1.0.3)
    @react-native-firebase/analytics: ^7.6.4 => 7.6.10
    @react-native-firebase/app: ^8.4.3 => 8.4.7
    @react-native-firebase/crashlytics: ^8.4.5 => 8.5.2
    @react-native-picker/picker: ^1.9.8 => 1.9.10
    @react-navigation/bottom-tabs: ^5.8.0 => 5.11.7
    @react-navigation/native: ^5.7.3 => 5.9.2
    @react-navigation/stack: ^5.9.0 => 5.14.2
    HelloWorld:  0.0.1
    aws-amplify: ^4.0.3 => 4.0.3
    axios: ^0.21.1 => 0.21.1
    babel-jest: ^26.2.2 => 26.6.3
    email-validator: ^2.0.4 => 2.0.4
    eslint: ^7.6.0 => 7.18.0
    hermes-inspector-msggen:  1.0.0
    jest: ^26.2.2 => 26.6.3
    jetifier: ^2.0.0 => 2.0.0 (1.6.6)
    libphonenumber-js: ^1.7.56 => 1.9.9
    libphonenumber-js-core:  1.0.0
    libphonenumber-js-max:  1.0.0
    libphonenumber-js-min:  1.0.0
    libphonenumber-js-mobile:  1.0.0
    lottie-ios: 3.1.8 => 3.1.8
    lottie-react-native: ^3.5.0 => 3.5.0
    metro-react-native-babel-preset: ^0.61.0 => 0.61.0 (0.59.0)
    millify: ^3.3.0 => 3.5.0
    password-validator: ^5.1.0 => 5.1.1
    qs: ^6.9.4 => 6.9.6 (6.5.2)
    react: 16.13.1 => 16.13.1
    react-animated:  0.1.0
    react-native: 0.63.2 => 0.63.2
    react-native-android-open-settings: 1.3.0 => 1.3.0
    react-native-code-push: ^6.3.0 => 6.4.1
    react-native-flipper: ^0.61.0 => 0.61.0 (0.37.0)
    react-native-gesture-handler: ^1.7.0 => 1.9.0
    react-native-image-crop-picker: ^0.33.2 => 0.33.4
    react-native-inset-shadow: ^1.0.3 => 1.0.3
    react-native-linear-gradient: ^2.5.6 => 2.5.6
    react-native-loading-spinner-overlay: ^1.1.0 => 1.1.0
    react-native-localize: ^1.4.2 => 1.4.3
    react-native-modal: ^11.5.6 => 11.6.1
    react-native-modal-datetime-picker: 9.2.0 => 9.2.0
    react-native-modal-selector: ^2.0.3 => 2.0.3
    react-native-number-ticker: ^0.1.5 => 0.1.5
    react-native-offline: ^5.7.0 => 5.7.0
    react-native-otp-textinput: 0.0.8 => 0.0.8
    react-native-permissions: 3.0.0 => 3.0.0
    react-native-picker-select: ^8.0.4 => 8.0.4
    react-native-reanimated: ^1.10.1 => 1.13.2
    react-native-responsive-screen: ^1.4.1 => 1.4.2
    react-native-safe-area-context: ^3.1.4 => 3.1.9
    react-native-screens: ^2.9.0 => 2.17.1
    react-native-splash-screen: ^3.2.0 => 3.2.0
    react-native-swiper: ^1.6.0 => 1.6.0
    react-native-ticker: ^4.0.0 => 4.0.0
    react-native-toast-message: ^1.4.9 => 1.4.9
    react-native-user-avatar: ^1.0.7 => 1.0.7
    react-native-vector-icons: ^7.0.0 => 7.1.0
    react-native-version-check: ^3.4.1 => 3.4.2
    react-redux: ^7.2.1 => 7.2.2
    react-test-renderer: 16.13.1 => 16.13.1
    redux: ^4.0.5 => 4.0.5
    redux-flipper: ^1.3.1 => 1.4.2
    redux-logger: ^3.0.6 => 3.0.6
    redux-saga: ^1.1.3 => 1.1.3
    redux-saga/effects:  undefined ()
    responsive-screen:  0.1.0
    responsive-screen-orientation-change:  0.1.0
    responsive-screen-styled-components:  0.1.0
    rn-async-storage-flipper: ^0.0.9 => 0.0.9
    rn-nodeify: ^10.3.0 => 10.3.0
  npmGlobalPackages:
    @aws-amplify/cli: 4.51.2
    appcenter-cli: 2.7.3
    appium-doctor: 1.16.0
    appium: 1.20.2
    code-push-cli: 3.0.0
    expo-cli: 3.28.5
    grunt-cli: 1.3.2
    gulp-cli: 2.3.0
    ios-deploy: 1.11.4
    n: 7.0.0
    npm: 6.14.8
    react-native-cli: 2.0.1

Describe the bug

Endpoints are not getting updated in aws pinpoints and getting error AWSPinpointProvider - updateEndpoint failed TypeError: Cannot read property 'byteLength' of undefined.

Expected behavior

Endpoints should get updated in aws pinpoints

Reproduction steps

Screenshot 2021-06-03 at 5 55 09 PM Please check attached screenshot

Code Snippet

// Put your code below this line.

Log output

[DEBUG] 39:30.825 Amplify - amplify config {aws_project_region: "us-east-1", aws_cognito_identity_pool_id: "us-east-1:xxxxx", aws_cognito_region: "us-east-1", oauth: {…}, aws_mobile_analytics_app_id: "xxxx", …}
ConsoleLogger.js:97 [DEBUG] 39:30.856 I18n - configure I18n
ConsoleLogger.js:97 [DEBUG] 39:30.858 I18n - create I18n instance
ConsoleLogger.js:97 [DEBUG] 39:30.859 AuthClass - configure Auth
ConsoleLogger.js:107 [DEBUG] 39:30.861 Parser - parse config (3) [{…}, "to amplifyconfig", {…}]
ConsoleLogger.js:107 [DEBUG] 39:30.876 Hub - Dispatching to auth with  {event: "configured", data: null, message: "The Auth category has been configured successfully"}
ConsoleLogger.js:107 [DEBUG] 39:30.890 Hub - Dispatching to auth with  {event: "configured", data: null, message: "The Auth category has been configured successfully"}
ConsoleLogger.js:107 [DEBUG] 39:30.892 AnalyticsClass - on hub capsule auth {event: "configured", data: null, message: "The Auth category has been configured successfully"}
ConsoleLogger.js:107 [DEBUG] 39:30.894 AnalyticsClass - configure Analytics {aws_project_region: "us-east-1", aws_cognito_identity_pool_id: "us-east-1:xxxx", aws_cognito_region: "us-east-1", oauth: {…}, aws_mobile_analytics_app_id: "xxxxxxx", …}
ConsoleLogger.js:107 [DEBUG] 39:30.907 Parser - parse config (3) [{…}, "to amplifyconfig", {…}]
ConsoleLogger.js:107 [DEBUG] 39:30.909 AWSPinpointProvider - configure Analytics {disabled: undefined, autoSessionRecord: true, appId: "xxxxx", region: "us-east-1"}
ConsoleLogger.js:97 [DEBUG] 39:30.925 AsyncStorageCache - Get item: key is AWSPinpoint_xxxxxxxx with options undefined
ConsoleLogger.js:107 [DEBUG] 39:30.944 Hub - Dispatching to analytics with  {event: "configured", data: null, message: "The Analytics category has been configured successfully"}
ConsoleLogger.js:107 [DEBUG] 39:30.975 AnalyticsClass - on hub capsule analytics {event: "configured", data: null, message: "The Analytics category has been configured successfully"}
ConsoleLogger.js:107 [DEBUG] 39:31.7 AnalyticsClass - current configuration {autoSessionRecord: true, AWSPinpoint: {…}, aws_project_region: "us-east-1", aws_cognito_identity_pool_id: "us-east-1:xxxx", aws_cognito_region: "us-east-1", …}
ConsoleLogger.js:97 [DEBUG] 39:31.11 Storage - storage configure called
ConsoleLogger.js:97 [DEBUG] 39:31.26 StorageClass - configure Storage
ConsoleLogger.js:107 [DEBUG] 39:31.43 Parser - parse config (3) [{…}, "to amplifyconfig", {…}]
ConsoleLogger.js:107 [DEBUG] 39:31.79 AWSS3Provider - configure Storage undefined
ConsoleLogger.js:97 [DEBUG] 39:31.91 Storage - storage vault configure called
ConsoleLogger.js:97 [DEBUG] 39:31.92 StorageClass - configure Storage
ConsoleLogger.js:107 [DEBUG] 39:31.94 Parser - parse config (3) [{…}, "to amplifyconfig", {…}]
ConsoleLogger.js:107 [DEBUG] 39:31.107 AWSS3Provider - configure Storage undefined
ConsoleLogger.js:107 [DEBUG] 39:31.108 RestAPI - configure Rest API {opt: {…}}
ConsoleLogger.js:97 [DEBUG] 39:31.109 RestAPI - create Rest API instance
ConsoleLogger.js:107 [DEBUG] 39:31.110 RestClient - API Options {endpoints: Array(0), aws_project_region: "us-east-1", aws_cognito_identity_pool_id: "us-east-1:xxxx", aws_cognito_region: "us-east-1", oauth: {…}, …}
ConsoleLogger.js:107 [DEBUG] 39:31.112 PubSub - configure PubSub {opt: {…}}
ConsoleLogger.js:107 [DEBUG] 39:31.124 GraphQLAPI - configure GraphQL API {opt: {…}}
ConsoleLogger.js:97 [DEBUG] 39:31.125 GraphQLAPI - create Rest instance
ConsoleLogger.js:107 [DEBUG] 39:31.126 RestClient - API Options {aws_project_region: "us-east-1", aws_cognito_identity_pool_id: "us-east-1:xxxx", aws_cognito_region: "us-east-1", oauth: {…}, aws_mobile_analytics_app_id: "xxxxxx", …}
ConsoleLogger.js:107 [DEBUG] 39:31.128 RestAPI - configure Rest API {opt: {…}}
ConsoleLogger.js:97 [DEBUG] 39:31.140 RestAPI - create Rest API instance
ConsoleLogger.js:107 [DEBUG] 39:31.141 RestClient - API Options {endpoints: Array(0), aws_project_region: "us-east-1", aws_cognito_identity_pool_id: "us-east-1:xxxxx", aws_cognito_region: "us-east-1", oauth: {…}, …}
ConsoleLogger.js:107 [DEBUG] 39:31.142 GraphQLAPI - configure GraphQL API {opt: {…}}
ConsoleLogger.js:97 [DEBUG] 39:31.143 GraphQLAPI - create Rest instance
ConsoleLogger.js:107 [DEBUG] 39:31.144 RestClient - API Options {aws_project_region: "us-east-1", aws_cognito_identity_pool_id: "us-east-1:xxxxx", aws_cognito_region: "us-east-1", oauth: {…}, aws_mobile_analytics_app_id: "xxxxx", …}
ConsoleLogger.js:107 [DEBUG] 39:31.156 Interactions - configure Interactions {opt: {…}}
ConsoleLogger.js:107 [DEBUG] 39:31.158 XR - configure XR {opt: {…}}
ConsoleLogger.js:107 [DEBUG] 39:31.159 AbstractXRProvider - configure SumerianProvider {aws_project_region: "us-east-1", aws_cognito_identity_pool_id: "us-east-1:xxxx", aws_cognito_region: "us-east-1", oauth: {…}, aws_mobile_analytics_app_id: "xxxx", …}
ConsoleLogger.js:107 [DEBUG] 39:31.161 Predictions - configure Predictions {aws_project_region: "us-east-1", aws_cognito_identity_pool_id: "us-east-1:xxxx", aws_cognito_region: "us-east-1", oauth: {…}, aws_mobile_analytics_app_id: "xxxx", …}
ConsoleLogger.js:107 [DEBUG] 39:49.591 Notification - Get the token from Firebase Service duTx27RAQLaNdWhvGmRRy7:xxxxxx
ConsoleLogger.js:107 [DEBUG] 39:49.592 Notification - update endpoint in push notification duTx27RAQLaNdWhvGmRRy7:xxx
[Violation] Forced reflow while executing JavaScript took 51ms
ConsoleLogger.js:107 [DEBUG] 39:53.612 Notification - refresh the device token with xxx
ConsoleLogger.js:107 [DEBUG] 39:53.615 AWSPinpointProvider - _public record {event: {…}, provider: undefined}
ConsoleLogger.js:97 [DEBUG] 39:53.629 Credentials - getting credentials
ConsoleLogger.js:97 [DEBUG] 39:53.631 Credentials - picking up credentials
ConsoleLogger.js:97 [DEBUG] 39:53.633 Credentials - getting new cred promise
ConsoleLogger.js:97 [DEBUG] 39:53.647 Credentials - checking if credentials exists and not expired
ConsoleLogger.js:97 [DEBUG] 39:53.650 Credentials - need to get a new credential or refresh the existing one
ConsoleLogger.js:97 [DEBUG] 39:53.663 Credentials - no credentials for expiration check
ConsoleLogger.js:97 [DEBUG] 39:53.667 AuthClass - Getting current user credentials
ConsoleLogger.js:107 [DEBUG] 39:53.683 AuthClass - failed to get or parse item aws-amplify-federatedInfo SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at AuthClass.<anonymous> (Auth.js:1349)
    at step (tslib.js:141)
    at Object.next (tslib.js:122)
    at fulfilled (tslib.js:112)
    at tryCallOne (core.js:37)
    at core.js:123
    at JSTimers.js:274
    at _callTimer (JSTimers.js:130)
    at _callImmediatesPass (JSTimers.js:181)
ConsoleLogger.js:97 [DEBUG] 39:53.695 AuthClass - Getting current session
ConsoleLogger.js:107 [DEBUG] 39:53.697 AuthClass - getting session failed undefined
ConsoleLogger.js:97 [DEBUG] 39:53.699 Credentials - setting credentials for guest
ConsoleLogger.js:107 [DEBUG] 39:55.36 Credentials - Failed to load credentials Promise {_U: 1, _V: 3, _W: Promise, _X: null}
ConsoleLogger.js:107 [DEBUG] 39:55.47 Credentials - Error loading credentials TypeError: response.blob is not a function
    at fetch-http-handler.js:54
    at tryCallOne (core.js:37)
    at core.js:123
    at JSTimers.js:274
    at _callTimer (JSTimers.js:130)
    at _callImmediatesPass (JSTimers.js:181)
    at MessageQueue.callImmediates [as _immediatesCallback] (JSTimers.js:441)
    at MessageQueue.__callImmediates (MessageQueue.js:387)
    at MessageQueue.js:135
    at MessageQueue.__guard (MessageQueue.js:364)
ConsoleLogger.js:107 [DEBUG] 39:55.50 AWSPinpointProvider - set credentials for analytics TypeError: response.blob is not a function
    at fetch-http-handler.js:54
    at tryCallOne (core.js:37)
    at core.js:123
    at JSTimers.js:274
    at _callTimer (JSTimers.js:130)
    at _callImmediatesPass (JSTimers.js:181)
    at MessageQueue.callImmediates [as _immediatesCallback] (JSTimers.js:441)
    at MessageQueue.__callImmediates (MessageQueue.js:387)
    at MessageQueue.js:135
    at MessageQueue.__guard (MessageQueue.js:364)
ConsoleLogger.js:97 [DEBUG] 39:55.53 AWSPinpointProvider - init clients
ConsoleLogger.js:107 [DEBUG] 39:55.65 AWSPinpointProvider - init clients with credentials {accessKeyId: undefined, sessionToken: undefined, secretAccessKey: undefined, identityId: undefined, authenticated: undefined}
ConsoleLogger.js:107 [DEBUG] 39:55.69 EventsBuffer - Instantiating buffer with config: {bufferSize: 1000, flushSize: 100, flushInterval: 5000, resendLimit: 5, disabled: undefined, …}
ConsoleLogger.js:107 [DEBUG] 39:55.118 AWSPinpointProvider - updateEndpoint error Error: No value provided for input HTTP label: EndpointId.
    at serializeAws_restJson1UpdateEndpointCommand$ (Aws_restJson1.js:3269)
    at tryCatch (runtime.js:63)
    at Generator.invoke [as _invoke] (runtime.js:293)
    at Generator.next (runtime.js:118)
    at tryCatch (runtime.js:63)
    at invoke (runtime.js:154)
    at runtime.js:189
    at tryCallTwo (core.js:45)
    at doResolve (core.js:200)
    at new Promise (core.js:66)
ExceptionsManager.js:179 [ERROR] 39:55.120 AWSPinpointProvider - updateEndpoint failed Error: No value provided for input HTTP label: EndpointId.
    at serializeAws_restJson1UpdateEndpointCommand$ (Aws_restJson1.js:3269)
    at tryCatch (runtime.js:63)
    at Generator.invoke [as _invoke] (runtime.js:293)
    at Generator.next (runtime.js:118)
    at tryCatch (runtime.js:63)
    at invoke (runtime.js:154)
    at runtime.js:189
    at tryCallTwo (core.js:45)
    at doResolve (core.js:200)
    at new Promise (core.js:66)
reactConsoleErrorHandler @ ExceptionsManager.js:179
n @ backend.js:32
registerError @ LogBox.js:148
errorImpl @ LogBox.js:59
console.error @ LogBox.js:33
ConsoleLogger._log @ ConsoleLogger.js:107
ConsoleLogger.error @ ConsoleLogger.js:163
(anonymous) @ AWSPinpointProvider.js:445
step @ tslib.js:143
(anonymous) @ tslib.js:124
(anonymous) @ tslib.js:117
tryCallTwo @ core.js:45
doResolve @ core.js:200
Promise @ core.js:66
__awaiter @ tslib.js:113
AWSPinpointProvider._handleEndpointUpdateFailure @ AWSPinpointProvider.js:431
(anonymous) @ AWSPinpointProvider.js:424
step @ tslib.js:143
(anonymous) @ tslib.js:124
rejected @ tslib.js:115
tryCallOne @ core.js:37
(anonymous) @ core.js:123
(anonymous) @ JSTimers.js:274
_callTimer @ JSTimers.js:130
_callImmediatesPass @ JSTimers.js:181
callImmediates @ JSTimers.js:441
__callImmediates @ MessageQueue.js:387
(anonymous) @ MessageQueue.js:135
__guard @ MessageQueue.js:364
flushedQueue @ MessageQueue.js:134
callFunctionReturnFlushedQueue @ MessageQueue.js:112
(anonymous) @ RNDebuggerWorker.js:2
Show 2 more frames
ConsoleLogger.js:107 [DEBUG] 39:55.403 Notification - update endpoint failed Error: No value provided for input HTTP label: EndpointId.
    at serializeAws_restJson1UpdateEndpointCommand$ (Aws_restJson1.js:3269)
    at tryCatch (runtime.js:63)
    at Generator.invoke [as _invoke] (runtime.js:293)
    at Generator.next (runtime.js:118)
    at tryCatch (runtime.js:63)
    at invoke (runtime.js:154)
    at runtime.js:189
    at tryCallTwo (core.js:45)
    at doResolve (core.js:200)
    at new Promise (core.js:66)

aws-exports.js

const awsmobile = {
    "aws_project_region": "us-east-1",
    "aws_cognito_identity_pool_id": "us-east-1:xxxxxxx",
    "aws_cognito_region": "us-east-1",
    "oauth": {},
    "aws_mobile_analytics_app_id": "xxxxxxxx",
    "aws_mobile_analytics_app_region": "us-east-1"
};

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 21 (8 by maintainers)

Most upvoted comments

Have traced the issue

Eventually tracked down to a package ‘fast-text-encoding’ which is required by Joi

it breaks Analytics as per previous updates

Replacing with “text-encoding-polyfill” resolves the issue and also resolves the await issue