<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cannot construct a Request with a Request object that has already been used. in Developer Q&amp;A Forum</title>
    <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204883#M172</link>
    <description>&lt;P&gt;I also tried with the latest Deno installation and Chrome, and I'm also getting a different error. The error comes from calling `fetch` twice, and this looks like either a bundling issue or an execution issue on the runtime side.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Feb 2023 08:17:12 GMT</pubDate>
    <dc:creator>stefan_baumgart</dc:creator>
    <dc:date>2023-02-16T08:17:12Z</dc:date>
    <item>
      <title>Cannot construct a Request with a Request object that has already been used.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204772#M161</link>
      <description>&lt;P&gt;Hi everyone!&lt;/P&gt;
&lt;P&gt;I created an app function when triggered should create a new firewall.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;import { CreateFirewallCommand, NetworkFirewallClient } from '@aws-sdk/client-network-firewall';

export default async () =&amp;gt; {
  const clientConfig = {
    region: 'us-east-1',
    credentials: {
      accessKeyId: '',
      secretAccessKey: '',
    },
  };

  const networkFirewallClient = new NetworkFirewallClient(clientConfig);

  const params = {
    FirewallName: 'VPC Firewall 2',
    // eslint-disable-next-line no-secrets/no-secrets
    FirewallPolicyArn: 'arn‌‌network-firewall:us-east-1:123456789012:firewall-policy/my-policy',
    VpcId: 'vpc-0af6340303f3168d3',
    SubnetMappings: [{ SubnetId: 'subnet-005fedf40f2e91595', Tier: 'PUBLIC' }],
  };

  try {
    const command = new CreateFirewallCommand(params);
    const response = await networkFirewallClient.send(command);
    console.log('Firewall successfully created:', response.Firewall.FirewallId);
    return response;
  } catch (err) {
    console.error('An error occurred:', err);
    throw err;
  }
};&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem is that I am not able to make any successful request because AWS rejects it because it was already send. I got this error code back:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarkusHobisch_0-1676387539153.png" style="width: 400px;"&gt;&lt;img src="https://community.dynatrace.com/t5/image/serverpage/image-id/9952i2D89CF370E24F81C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarkusHobisch_0-1676387539153.png" alt="MarkusHobisch_0-1676387539153.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I am not sure now if this is a problem within the server.js file or if the problem is somewhere else? Do you have any suggestions?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers&lt;/P&gt;
&lt;P&gt;Markus&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 13:42:21 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204772#M161</guid>
      <dc:creator>MarkusHobisch</dc:creator>
      <dc:date>2023-05-02T13:42:21Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot construct a Request with a Request object that has already been used.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204819#M165</link>
      <description>&lt;P&gt;For better seachability I add the error code in text form:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[ERROR] /api/aws-firewall Fehler beim Erstellen der Firewall: Error: AWS SDK error wrapper for TypeError: Cannot construct a Request with a Request object that has already been used.
    at asSdkError (C:\Users\markus.hobisch\IdeaProjects\dynatrace-cpa\api\aws-firewall.js:5133:10)
    at C:\Users\markus.hobisch\IdeaProjects\dynatrace-cpa\api\aws-firewall.js:5182:21
    at async C:\Users\markus.hobisch\IdeaProjects\dynatrace-cpa\api\aws-firewall.js:4726:20
    at async Module.aws_firewall_default (C:\Users\markus.hobisch\IdeaProjects\dynatrace-cpa\api\aws-firewall.js:7144:22)
    at async Socket.&amp;lt;anonymous&amp;gt; (C:\Users\markus.hobisch\IdeaProjects\dynatrace-cpa\node_modules\@dynatrace\runtime-simulator\lib\server.js:395:53) {
  '$metadata': { attempts: 1, totalRetryDelay: 0 }&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Feb 2023 08:22:20 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204819#M165</guid>
      <dc:creator>MarkusHobisch</dc:creator>
      <dc:date>2023-02-15T08:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot construct a Request with a Request object that has already been used.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204821#M166</link>
      <description>&lt;P&gt;Hi Markus,&lt;/P&gt;
&lt;P&gt;I can reproduce the issue. The internal error is following:&lt;/P&gt;
&lt;PRE&gt;Exception has occurred: TypeError: Cannot construct a Request with a Request object that has already been used.&lt;BR /&gt;&lt;SPAN&gt;  at new Request (/node_modules/undici/lib/fetch/request.js:482:15)&lt;BR /&gt;  at fetch (/node_modules/undici/lib/fetch/index.js:137:21)&lt;BR /&gt;  at fetch (/node_modules/undici/index.js:111:20)&lt;BR /&gt;  at /node_modules/@dynatrace/runtime-simulator/lib/server.js:1:3560&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;We are further looking into the issue and will keep you posted.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 08:27:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204821#M166</guid>
      <dc:creator>stefan_eggersto</dc:creator>
      <dc:date>2023-02-15T08:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot construct a Request with a Request object that has already been used.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204858#M169</link>
      <description>&lt;P&gt;Did you try your Code with Node.js or a similar platform? Can you ensure that the problem lies within the execution via the Dynatrace Serverless Platform and not with the usage of the API?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 14:59:38 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204858#M169</guid>
      <dc:creator>stefan_baumgart</dc:creator>
      <dc:date>2023-02-15T14:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot construct a Request with a Request object that has already been used.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204869#M170</link>
      <description>&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;did not try it out on &lt;SPAN&gt;Node.js&lt;/SPAN&gt; so far but I can and would let you know.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 15:48:13 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204869#M170</guid>
      <dc:creator>MarkusHobisch</dc:creator>
      <dc:date>2023-02-15T15:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot construct a Request with a Request object that has already been used.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204879#M171</link>
      <description>&lt;P&gt;It works on Node.js. At least I get a different error (InvalidRequestException: Resource name has an invalid format) but this is fine because I didn't checked the format so far.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 16:32:56 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204879#M171</guid>
      <dc:creator>MarkusHobisch</dc:creator>
      <dc:date>2023-02-15T16:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot construct a Request with a Request object that has already been used.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204883#M172</link>
      <description>&lt;P&gt;I also tried with the latest Deno installation and Chrome, and I'm also getting a different error. The error comes from calling `fetch` twice, and this looks like either a bundling issue or an execution issue on the runtime side.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 08:17:12 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204883#M172</guid>
      <dc:creator>stefan_baumgart</dc:creator>
      <dc:date>2023-02-16T08:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot construct a Request with a Request object that has already been used.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204887#M173</link>
      <description>&lt;P&gt;We identified the issue, and it's a bug in the simulator. This error should not appear once the function is deployed.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Feb 2023 18:03:30 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204887#M173</guid>
      <dc:creator>stefan_baumgart</dc:creator>
      <dc:date>2023-02-15T18:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot construct a Request with a Request object that has already been used.</title>
      <link>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204924#M174</link>
      <description>&lt;P&gt;Thanks for the update!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Feb 2023 07:46:49 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Developer-Q-A-Forum/Cannot-construct-a-Request-with-a-Request-object-that-has/m-p/204924#M174</guid>
      <dc:creator>MarkusHobisch</dc:creator>
      <dc:date>2023-02-16T07:46:49Z</dc:date>
    </item>
  </channel>
</rss>

