Embedded q search bar not displaying

The QuickSight search bar was previously functional but is now failing to load or display according to a report from the client. Upon investigation, no errors were found on the client side. Similarly, examination of the Lambda function responsible for generating the URL, utilizing the GenerateEmbedUrlForRegisteredUserCommand , did not reveal any errors. The generated URL appears to be valid, although confirmation is needed.

The steps outlined in the documentation for integrating the QuickSight embedded analytics Q search bar for authenticated users were followed meticulously.
Embedding the Amazon QuickSight Q search bar for registered users - Amazon QuickSight.

The console messages from the QuickSight SDK suggest that everything is in order without any apparent issues. However, the search bar is still not functioning as expected.

Update: I found an error while trying out the url in browser.
[
{
“level”: “WARN”,
“text”: “Could not find string for this key: CONNECTION_TYPES_GOOGLESHEETS”,
“appType”: “EMBEDDING”,
“pageType”: “Merlin”
},
{
“level”: “WARN”,
“text”: “The Application Pluging Runtime has not been fully defined and is not yet ready for use.”,
“appType”: “EMBEDDING”,
“pageType”: “Merlin”
},
{
“level”: “WARN”,
“text”: “NavigationUrlHelper: Page Type not found for /embedding/bab7bb53a05646378ab8b3f97af44a15/q/search/vQwebMhIqr97aY0qr6txB7rKbQYBHFSp. Please add corresponding page type”,
“appType”: “EMBEDDING”,
“pageType”: “Merlin”
},
{
“level”: “ERROR”,
“text”: “Unable to access local storage in embedded page”,
“appType”: “EMBEDDING”,
“pageType”: “Unknown”
}
]

Hello @Marc, the key point I am seeing in your logs is that first yellow highlighted point in the screenshot that says embedDashboard is called with unrecognized properties. It seems like one of the variables that are being passed into that function is not providing the expected value. Maybe that will lead you to the issue you are currently facing.

1 Like

Hey @DylanM , the embedDashboard function is functioning properly. Currently, I have two embeds on a single page, one being the Q search bar and the other the dashboard. I attempted to remove the embedDashboard, leaving only the Q search bar embed intact. Embed Q search bar still not displaying.

1 Like

Hello @Marc, I think I need some more information to try and debug this issue. Are you able to share any of the code you wrote to embed this? Don’t forget to anonymize any important information like AccountID. I just need to see what is going on so I can try to pinpoint where an error could be coming from. The logs presented above are usually nonsense that is constantly displayed in QuickSight logs.

@DylanM

Here’s how my JavaScript is structured.

<div id="experience-container"></div>

        async function embedQSearchBar() {
            const { createEmbeddingContext } = QuickSightEmbedding;
            const embeddingQContext = await createEmbeddingContext({
                    onChange: (changeEvent, metadata) => {
                        console.log('Context received a change', changeEvent, metadata);
                    },
                });
                const frameOptions = {
                    url: embed_url, // replace this value with the url generated via embedding API
                    container: '#experience-container',
                    height: "100%",
                    width: "100%",
                    onChange: (changeEvent, metadata) => {
                        switch (changeEvent.eventName) {
                            case 'FRAME_MOUNTED': {
                                console.log("Do something when the experience frame is mounted.");
                                break;
                            }
                            case 'FRAME_LOADED': {
                                console.log("Do something when the experience frame is loaded.");
                                break;
                            }
                        }
                    },
                };
        const embeddedDashboardExperience = await embeddingQContext.embedQSearchBar(frameOptions);

        }

For generating URLs, I utilize Cognito user.

import {  CognitoIdentityProviderClient, AdminInitiateAuthCommand, AdminGetUserCommand} from "@aws-sdk/client-cognito-identity-provider";
import { CognitoIdentityClient, GetOpenIdTokenCommand, GetIdCommand  } from "@aws-sdk/client-cognito-identity"; 
import { STSClient, AssumeRoleWithWebIdentityCommand } from "@aws-sdk/client-sts";
import { QuickSightClient, GetDashboardEmbedUrlCommand, RegisterUserCommand, GenerateEmbedUrlForRegisteredUserCommand  } from "@aws-sdk/client-quicksight";

const  getQEmbedUrl = async (clientQuicksight, topicId = "*********") => {
  const getQSearchBarParams = {
        "AwsAccountId": "178*******",
                "ExperienceConfiguration": {
                    "QSearchBar": {
                        "InitialTopicId": topicId
                    }
                },
                "UserArn": "arn:aws:quicksight:us-east-1:*********:user/default/QuickSightEmbeddingCognito-CognitoAuthorizedRole-*********/unique-session-identifier"
    };
    
    const command = new GenerateEmbedUrlForRegisteredUserCommand(getQSearchBarParams);
    const responseClient = await clientQuicksight.send(command);
        const  result = {
          statusCode: 200,
          headers: {
            "Access-Control-Allow-Origin": "*",
            "Access-Control-Allow-Headers": "Content-Type",
          },
          body: JSON.stringify(responseClient),
          isBase64Encoded: false,
        };
    return result;
};
export const handler = async (event) => {
      const queryParams = event.queryStringParameters;
  const config = {region: 'us-west-2'};
  const clientCognitoIdentityProvider = new CognitoIdentityProviderClient(config);
  const clientCognitoIdentity = new CognitoIdentityClient(config);
  const clientStsClient = new STSClient(config);
  const input = {
    AuthFlow: "ADMIN_NO_SRP_AUTH",
    ClientId: "*********",
    UserPoolId: "us-west-2*********",
    AuthParameters: {
      USERNAME : "*********",
      PASSWORD: "*********@*********"
    }
  }

// Authenticate Cognito User
  const command = new AdminInitiateAuthCommand (input);
  const authResult = await clientCognitoIdentityProvider.send(command);
  const inputGetId = {
    AccountId: '*********',
    IdentityPoolId: "us-west-2:*********",
    Logins: {
      "cognito-idp.us-west-2.amazonaws.com/*********" : authResult.AuthenticationResult.IdToken
    }
  };
  const commandGetId = new GetIdCommand(inputGetId);
  const identityResult = await clientCognitoIdentity.send(commandGetId);
  const inputGetOpenIdToken= {
    IdentityId : identityResult.IdentityId,
    Logins: {
      "cognito-idp.us-west-2.amazonaws.com/*********" : authResult.AuthenticationResult.IdToken
    }
  }
  
  const commandGetOpenIdToken = new GetOpenIdTokenCommand(inputGetOpenIdToken);
const openIdResult = await clientCognitoIdentity.send(commandGetOpenIdToken);
  const inputAssumeRole = {
    RoleArn: "arn:aws:iam::*********:role/*********-*********-*********", // required
    RoleSessionName: "unique-session-identifier", // required
    WebIdentityToken: openIdResult.Token,
  }
  
  // Assume role 
  const commandAssumeRole = new AssumeRoleWithWebIdentityCommand(inputAssumeRole);
  const assumeRole = await clientStsClient.send(commandAssumeRole);
const clientQuicksight = new QuickSightClient({
  region: 'us-west-2',
  credentails: {
    accessKeyId: assumeRole.Credentials.AccessKeyId,
    secretAccessKey: assumeRole.Credentials.SecretAccessKey,
    sessionToken: assumeRole.Credentials.SessionToken,
    expiration: assumeRole.Credentials.Expiration
  }
});


return getQEmbedUrl(clientQuicksight, queryParams.topicId);
   


};

Additional Details:

  • I have tested both v2.5 and v2.6 of the quicksight sdk library.
  • I have tried another cognito user
  • I have checked role permission and quicksight permission(Reader, domain, embed)
1 Like

Hello @Marc, I am curious about something. When you are running this locally, are you seeing an error within the Q Search bar div? It would look something like this:

Or, is the div not appearing on the screen at all? Check your developer tools tab and look through the HTML appearing to see if the div is showing there for the experience-container.

My thought is, that the div might actually exist but styling needs to be completed on the div in JavaScript. In the frame options you set it to take 100% height and width, but the div itself may be taking up almost 0 height so 100% wouldn’t display.

Here is what I found.
image

Thanks for helping out; I really appreciate you taking the time to look into this.

This is the div.


@DylanM

image

Hello @Marc, I have one final question, is the Q search bar functional within your QuickSight console? Is there any chance you set up the free trial version of Q and did not set up payment for the full access when that expired? That is my last thought on this without being able to see it directly.

If Q is still enabled on your QuickSight account, I would recommend filing a case with AWS Support where we can dive into the details so that we can help you further. Here are the steps to open a support case. If your company has someone who manages your AWS account, you might not have direct access to AWS Support and will need to raise an internal ticket to your IT team or whomever manages your AWS account. They should be able to open an AWS Support case on your behalf. Hope this helps!

Hi @Marc @DylanM the same problem recently appeared on our account. The Embedded Q bar was working for the last 30-60 days, and just recently disappeared. Joined the community to look for answers and came across this thread.
I just confirmed the Q Bar is still enabled.

Additional Details:

  • The Q search bar URL is generated successfully in our Lambda function.
  • It was working before but suddenly it isn’t anymore, but dashboard embedding works fine.
  • I have tested both v2.5 and v2.6 of the quicksight sdk library.
  • I have tried to use another cognito user
  • I have checked role permission and quicksight permission(Reader, domain, embed)
1 Like

@DylanM :! The Q search bar remains functional in quicksight console. Initially, I activated the free trial version in the us-east-1 region and later deactivated it before enabling Q in the us-west-2 region. This decision was made because all of our datasets are located in us-west-2.

Hello @Marc, based on the response from @jmcgee, it seems like there may be a bug currently with the Q embedding. Would you 2 be able to follow the steps I linked above to file a ticket with Support? Maybe it is something they know about and are working on a solution, but they might be able to guide you.

Hi @DylanM , we’re having exactly the same issue. We have multiple pages in our portal with embedded Q that suddenly stopped working, with no code or settings modifications

Are these GenBI topics? You can tell if they have a sparkle next to the name in the topic list. If so embedding is not supported in preview, but will be available when we GA.
GenBI Topic

2 Likes

Removing GenBI resolves the issue, and now the Q search bar is visible. Thanks!

2 Likes

@Marc @jmcgee @markten
I’m working to have correct errors emitted when such cases happen.
Can you help me with some additional information to be able to understand the complete setup you have in your QS account and the Q embedding.

  1. When the Q bar was working, what topics (legacy vs GenBI) you/the user had access to in their QS account?
  2. When Q bar was working, what was the initialTopicId used?
  3. When Q bar was working, did you have allowTopicSelection true or false?
  4. I’m assuming you did not make ANY change to the embedding code when Q bar stopped working?
  5. What topics did you convert to GenBI or created from scratch after which the Q bar stopped working?
  6. If answer to 4. is yes and IF the legacy topic(s) are still available ideally the Q bar should not have stopped working. Did you delete any legacy topics you have access to, or changed the initialTopicId in the embedding code?

Please note, do not share any personal information here. For information on topics you can simple describe as Topic 1, type legacy, created MMDDYY; Topic 2, type GenBI, created MMDDYY etc.

Thanks

@Marc @DylanM we found the issue that impacted us. A feature that’s still in preview was enabled in our QuickSight console. Disabling this feature resolves the issue, and now we can use the Q search bar again.
Embedding_Quicksight

Check your environments to see if this was inadvertantly enabled

1 Like
  1. When the Q bar was working, what topics (legacy vs. GenBI) did you or the user have access to in their Amazon QuickSight account?
  • Answer: When the Q bar was functional, I shared a topic with the users. The topic ID was vQwebMhIqr97aY0qr6txB7rKbQYBHFSp.
  1. What was the initialTopicId used when the Q bar was working?
  • Answer: The initialTopicId used during that time was vQwebMhIqr97aY0qr6txB7rKbQYBHFSp.
  1. When the Q bar was working, did you have allowTopicSelection set to true or false?
  • Answer: I did not explicitly set the allowTopicSelection parameter during that period.
  1. Did you make any changes to the embedding code when the Q bar stopped working?
  • Answer: No, there were no changes made to the embedding code.
  1. What topics did you convert to GenBI or create from scratch after which the Q bar stopped working?
  • Answer: converted the topic with the ID vQwebMhIqr97aY0qr6txB7rKbQYBHFSp to GenBI. However, this topic no longer exists on my end.
  1. If the answer to question 4 is yes and IF the legacy topic(s) are still available, ideally the Q bar should not have stopped working. Did you delete any legacy topics you had access to or change the initialTopicId in the embedding code?
  • Answer: Yes, I deleted the legacy topic with the ID vQwebMhIqr97aY0qr6txB7rKbQYBHFSp, and I also changed the initialTopicId in the embedding code.
    cc: @shyamal

Since the legacy topic was deleted and the initialTopicID in the embedding code was changed, this issue happened. If the legacy topic and the embedding code (initialTopicId) is left untouched, creating GenBI topics will not affect the existing Q embedding.