What is Causing the Runtime Error in the Pipedreamin CLI Core's Goroutine 20?

This topic was automatically generated from Slack. You can find the original thread here.

goroutine 20 [running]:
pd/core.determineAppAuthProvisionID({{0xc00010ed90, 0x7}, {0xc00010ed97, 0x3}, 0x0, {0xc00010eda0, 0x7}, {0x0, 0x0}, {0x0, …}, …}, …)
/runner/_work/pipedreamin/pipedreamin/cli/core/configure_props.go:54 +0x19a
pd/core.configureAppProp({{0xc00010ed90, 0x7}, {0xc00010ed97, 0x3}, 0x0, {0xc00010eda0, 0x7}, {0x0, 0x0}, {0x0, …}, …}, …)
/runner/_work/pipedreamin/pipedreamin/cli/core/configure_props.go:152 +0x1e5
pd/core.configureProp({{0xc0000d6800, 0x7f9}, {0xc0001ac040, 0x40}, {0xc000388a00, 0x5, 0x8}, {0xc00010ed84, 0xa}, {0xc00001e1e0, …}, …}, …)
/runner/_work/pipedreamin/pipedreamin/cli/core/configure_props.go:303 +0x4ac
pd/core.ConfigureProps({{0xc0000d6800, 0x7f9}, {0xc0001ac040, 0x40}, {0xc000388a00, 0x5, 0x8}, {0xc00010ed84, 0xa}, {0xc00001e1e0, …}, …}, …)
/runner/_work/pipedreamin/pipedreamin/cli/core/configure_props.go:500 +0x170
pd/cmd.glob…func6.3.1({0xc00001e0d8?, 0xdee180?}, 0xc00018a380, 0xc0002f1e98?, 0xc000184300, 0xc0001880f8, 0xc000188100)
/runner/_work/pipedreamin/pipedreamin/cli/cmd/dev.go:174 +0x29a
pd/cmd.glob…func6.3()
/runner/_work/pipedreamin/pipedreamin/cli/cmd/dev.go:215 +0x33
pd/cmd.glob…func6.4()
/runner/_work/pipedreamin/pipedreamin/cli/cmd/dev.go:224 +0x3d
created by pd/cmd.glob…func6 in goroutine 1
/runner/_work/pipedreamin/pipedreamin/cli/cmd/dev.go:223 +0x539

It appears you’re encountering a runtime error related to the configuration of an app property in a Pipedream component or workflow, specifically within the Go environment or a related CLI operation. The error trace indicates an issue during the execution of a function that determines the app’s authentication provision ID and configures app properties. Without specific details about the context in which this error occurred (e.g., the operation you were attempting, the specific component or workflow configuration), it’s challenging to provide a precise solution. However, the error suggests there might be an issue with how an app’s authentication or properties are being configured or accessed in your code. To assist you better, could you provide more details about the following: - The specific task or operation you were trying to perform when this error occurred. - Any specific Pipedream component or workflow you were working with. - Whether this involves a custom component you’re developing or a pre-built component from Pipedream’s registry. Meanwhile, here are some general steps you can take to troubleshoot and potentially resolve this issue: 1. Review App Configuration: Ensure that the app property configuration in your component or workflow matches the expected structure and authentication requirements. This includes verifying that all required fields are correctly populated. 2. Authentication Details: Double-check the authentication details (e.g., API keys, OAuth tokens) to ensure they are correct and have the necessary permissions for the operations you’re attempting. 3. Component Code Review: If this error is related to a custom component you’re developing, review the component code to ensure it correctly implements the Pipedream component structure, especially regarding app property configuration and authentication handling. If you’re still encountering issues after these steps, please provide the additional information requested above for more targeted assistance.

C:\Users\m_his\OneDrive\Pictures\Documents\GitHub\pipedream-custom-sources-2\hubspot-meetings>pd dev hubspot_meetings.mjs
watch:add | C:\Users\m_his\OneDrive\Pictures\Documents\GitHub\pipedream-custom-sources-2\hubspot-meetings\hubspot_meetings.mjs
Configuring props…
Configuring prop hubspot…
panic: graphql: Cannot return null for non-nullable field Selectable.label

goroutine 43 [running]:
pd/core.determineAppAuthProvisionID({{0xc000087060, 0x7}, {0xc000087067, 0x3}, 0x0, {0xc000087070, 0x7}, {0x0, 0x0}, {0x0, …}, …}, …)
/runner/_work/pipedreamin/pipedreamin/cli/core/configure_props.go:54 +0x19a
pd/core.configureAppProp({{0xc000087060, 0x7}, {0xc000087067, 0x3}, 0x0, {0xc000087070, 0x7}, {0x0, 0x0}, {0x0, …}, …}, …)
/runner/_work/pipedreamin/pipedreamin/cli/core/configure_props.go:152 +0x1e5
pd/core.configureProp({{0xc00011c000, 0x7f9}, {0xc000022f00, 0x40}, {0xc00017f900, 0x5, 0x8}, {0xc000087054, 0xa}, {0xc0000aa438, …}, …}, …)
/runner/_work/pipedreamin/pipedreamin/cli/core/configure_props.go:303 +0x4ac
pd/core.ConfigureProps({{0xc00011c000, 0x7f9}, {0xc000022f00, 0x40}, {0xc00017f900, 0x5, 0x8}, {0xc000087054, 0xa}, {0xc0000aa438, …}, …}, …)
/runner/_work/pipedreamin/pipedreamin/cli/core/configure_props.go:500 +0x170
pd/cmd.glob…func6.3.1({0xc00001e0d8?, 0xdee180?}, 0xc000282980, 0xc0001a7e98?, 0xc0002b29a8, 0xc000288138, 0xc000288140)
/runner/_work/pipedreamin/pipedreamin/cli/cmd/dev.go:174 +0x29a
pd/cmd.glob…func6.3()
/runner/_work/pipedreamin/pipedreamin/cli/cmd/dev.go:215 +0x33
pd/cmd.glob…func6.4()
/runner/_work/pipedreamin/pipedreamin/cli/cmd/dev.go:224 +0x3d
created by pd/cmd.glob…func6 in goroutine 1
/runner/_work/pipedreamin/pipedreamin/cli/cmd/dev.go:223 +0x539

It appears you encountered a panic error while trying to configure a custom Pipedream source for HubSpot meetings using the pd dev command. The error message indicates an issue with the GraphQL query used in the process, specifically related to a non-nullable field Selectable.label that cannot return null. This issue might be related to the configuration of the props in your Pipedream component, especially around how the hubspot app prop is defined and how its options are fetched or defined. Without seeing the specific code of your hubspot_meetings.mjs file, it’s challenging to provide a precise solution. However, I can suggest a general approach to troubleshoot and potentially resolve this issue: 1. Review the props configuration: Ensure that the props for your HubSpot app are correctly configured, particularly any that use dynamic options fetched from an API. The error suggests that a label expected by the GraphQL query is null, which might happen if the data fetched does not meet the expected structure or if a default value is not provided where it’s needed. 2. Check for optional fields: If your component is fetching data that might not always be present (thus potentially null), ensure that these fields are marked as optional or that you provide a default value to prevent the GraphQL query from failing. 3. Debugging the GraphQL query: If your component involves making a GraphQL query to the HubSpot API or another service, double-check the query for correctness, especially around non-nullable fields. Ensure that all non-nullable fields in your query are guaranteed to return a value. 4. Consult Pipedream and HubSpot documentation: Review the Pipedream documentation for HubSpot to ensure your usage aligns with the examples and guidelines provided. Similarly, consult the HubSpot API documentation for details on the expected structure of requests and responses. 5. Local development and testing: Consider using the pd dev command with the --dc flag to link to an existing deployed component if you’re updating one. This might help isolate the issue by comparing the behavior of a newly deployed component versus an existing one. 6. Seek further assistance: If the issue persists, consider reaching out for more specific help. You can visit [Pipedream Support](https://pipedream.com

C:\Users\m_his\OneDrive\Pictures\Documents\GitHub\pipedream-custom-sources-2\hubspot-meetings>pd deploy hubspot_meetings2.mjs
Configuring props…
Configuring prop hubspot…
[error] graphql: Cannot return null for non-nullable field Selectable.label

It appears you’re encountering an error when trying to deploy a Pipedream component with the pd deploy command, specifically related to configuring the hubspot prop in your hubspot_meetings2.mjs file. The error message indicates an issue with the Selectable.label field, which suggests there might be a problem with how the options method is defined for a prop in your component, or a required field is missing or not correctly set up. Given the information provided, it’s crucial to ensure that every prop in your component that uses the options method to dynamically generate options for a UI select menu has both label and value fields properly defined for each option. The label is what’s displayed to the user in the Pipedream UI, and value is the actual value of the option. This error typically occurs when the label or value is missing, or if the options method does not return the expected array of objects with label and value properties. Here’s a simplified example of how to correctly define an options method within a prop: props: { exampleProp: { type: "string", label: "Example Prop", async options() { return [ { label: "Option 1", value: "option1" }, { label: "Option 2", value: "option2" }, // Make sure every object in this array has a label and a value ]; }, }, } Please review the options method(s) in your hubspot_meetings2.mjs file to ensure that every option returned has both a label and a value. If the issue persists, it might be helpful to share more details about the specific prop configuration that’s causing this error, so I can provide more targeted assistance.

this is the code :
import { axios } from “@pipedream/platform”;

export default defineComponent({
name: “HubSpot-Meetings-Source”,
description:
“This is a custom source to fetch meetings from HubSpot, with 15-minute timer intervals.”,
props: {
hubspot: {
type: “app”,
app: “hubspot”,
},
timer: {
type: “$.interface.timer”,
default: {
intervalSeconds: 15 * 60,
},
},
nango_connection_id: {
type: “string”,
label: “Nango Connection ID”,
description: “Enter the Nango Connection ID”,
},
nango_integration_id: {
type: “string”,
label: “Nango Integration ID”,
description: “Enter the Nango Integration ID”,
},
workflow_id: {
type: “string”,
label: “Workspace ID”,
description: “Enter the Workspace ID”,
},
},
dedupe: “greatest”,
async run({ steps, $ }) {
try {
// Step 1: Retrieve the HubSpot token from Nango
const nangoResponse = await axios($, {
method: “GET”,
headers: {
Authorization: Bearer ${process.env.VELORA_NANGO_SECRET_KEY},
},
url: https://api.nango.dev/connection/${this.nango_connection_id}?provider_config_key=${this.nango_integration_id},
});

  // Extract the HubSpot access token from the response
  const hubspot_token = nangoResponse.credentials.access_token;

  // Step 2: Use the HubSpot token to make a request to the HubSpot API
  const data = await axios($, {
    method: "GET",
    url: `${process.env.HUBSPOT_MEETINGS_API_URL}`,
    headers: {
      Authorization: `Bearer ${hubspot_token}`,
    },
  });

  // Step 3: Emit each meeting as an event
  data.forEach((meeting) => {
    this.$emit(meeting, {
      workflow_id: this.workflow_id,
    });
  });
} catch (error) {
  // Handle errors gracefully
  $.error(`Failed to fetch meetings: ${error.message}`);
}

},
});

this is the error;
C:\Users\m_his\OneDrive\Pictures\Documents\GitHub\pipedream-custom-sources-2\hubspot-meetings>pd deploy hubspot_meetings2.mjs
Configuring props…
Configuring prop hubspot…
[error] graphql: Cannot return null for non-nullable field Selectable.label

It appears you’re encountering an error during the deployment of a custom Pipedream source for fetching HubSpot meetings, which also involves using Nango for token management. The error message you’ve shared suggests an issue with configuring the hubspot prop during the deployment process: [error] graphql: Cannot return null for non-nullable field Selectable.label This error typically indicates that the deployment process expected a label field for one of your props (in this case, likely the hubspot prop), but it did not receive one. This could be due to a misconfiguration in how you’ve defined your props or an issue with the deployment process itself. Given the information provided, here are a few steps you can take to troubleshoot and potentially resolve this issue: 1. Check Prop Definitions: Ensure that all props in your component, especially those that involve selection from a list (like hubspot which is of type “app”), are correctly defined according to the Pipedream components documentation. Each prop of type “app” should have a corresponding label and description that helps identify it in the UI. However, the error seems to be from the deployment process itself, not the component code. 2. Review Environment Variables: The error does not directly relate to environment variables (VELORA_NANGO_SECRET_KEY and HUBSPOT_MEETINGS_API_URL), but ensure they are correctly set in your Pipedream environment if they are being used. 3. Pipedream CLI Version: Ensure your Pipedream CLI (pd) is up to date. An outdated CLI might not handle certain configurations correctly. You can update it by running npm install -g pipedreamhq/cli (assuming you initially installed it via npm). 4. Consult Pipedream Support: Given the error seems to be related to the deployment process and not directly to the code logic or API requests, reaching out to Pipedream support might provide more insight. They can offer guidance specific to the deployment process and any known issues with prop configurations. You can reach out to them at Support - Pipedream. 5. Debugging Deployment: Try deploying a simpler version of the component without the hubspot prop to see if the issue persists. This can help isolate whether the problem is with the hubspot app prop specifically or another part