Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need Help Resolving Persistent 409 Conflict Error: "Payloads Already Received" in API Call #3460

Open
AsharibAli opened this issue Nov 5, 2024 · 1 comment
Labels
question Further information is requested

Comments

@AsharibAli
Copy link
Contributor

Hi,

I'm encountering a recurring 409 Conflict {"detail":"Payloads already received"} error when trying to make GET requests to an API in Flowise using a custom tool.

Details:

  • Tool Description: Custom tool in Flowise to call an API endpoint for retrieving token details.
  • JS Function: Here’s the function I’m using in the tool:
    const fetch = require('node-fetch');
    
    async function searchEduChain(query) {
        const url = `https://edu-chain-testnet.blockscout.com/api/v2/search?q=${query}`;
        const options = {
            method: 'GET',
            headers: {
                'Content-Type': 'application/json'
            }
        };
    
        try {
            const response = await fetch(url, options);
            const data = await response.json();
            return data;
        } catch (error) {
            console.error(error);
            return '';
        }
    }
  • Issue: Each time I call the API, I receive the 409 Conflict error message "Payloads already received", indicating it thinks it's a duplicate request. I’ve tried various methods to ensure unique requests (timing adjustments, adding unique identifiers, etc.) but no luck.

Error Details (Server Log):

Error submitting tool outputs: BadRequestError: 400 Missing required parameter: 'tool_outputs[0].output'.

Error: Failed to batch create run: 409 Conflict {"detail":"Payloads already received"}

Tried Solutions:

  1. Implemented unique request IDs (where possible).
  2. Checked for any caching on the server side and implemented delays between calls.
  3. Verified that each request payload was distinct.

Any insights on handling this error in Flowise specifically, or suggestions on other ways to prevent the 409 Conflict error, would be greatly appreciated. Thanks in advance!

@HenryHengZJ @toi500

@HenryHengZJ
Copy link
Contributor

I dont think you need to wrap into a function: searchEduChain
Example: https://docs.flowiseai.com/integrations/langchain/tools/custom-tool

Have you tested if the API you are calling working outside of Flowise?

@HenryHengZJ HenryHengZJ added the question Further information is requested label Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants