awslabs / pireporter

A comprehensive tool for capturing performance metrics and workload snapshots, and generating in-depth comparison reports for Amazon Aurora PostgreSQL databases. Helps to troubleshoot problems, optimize instance size and cost.
Apache License 2.0
8 stars 4 forks source link

Error: InvalidInstanceType #4

Closed jayvardhancs closed 3 months ago

jayvardhancs commented 3 months ago

Discussed in https://github.com/awslabs/pireporter/discussions/3

Originally posted by **jayvardhancs** June 27, 2024 Hi, I am trying to learn the aws PI REPORTER tool and getting below error when trying to create snapshot. I have configured aws aurora portgres instance and instance type is db.x2g.xlarge. Kindly suggest here to fix the error. `[ec2-user@ip-172-31-22-201 portable]$ ./pireporter --create-snapshot --start-time 2024-06-27T09:00 --end-time 2024-06-27T09:50 -i pireporter-instance-1 InvalidInstanceType: The following supplied instance types do not exist: [x2g.xlarge] at throwDefaultError (/snapshot/pireporter/node_modules/@smithy/smithy-client/dist-cjs/index.js:838:20) at /snapshot/pireporter/node_modules/@smithy/smithy-client/dist-cjs/index.js:847:5 at de_DescribeInstanceTypesCommandError (/snapshot/pireporter/node_modules/@aws-sdk/client-ec2/dist-cjs/index.js:14627:10) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async /snapshot/pireporter/node_modules/@smithy/middleware-serde/dist-cjs/index.js:35:20 at async /snapshot/pireporter/node_modules/@smithy/core/dist-cjs/index.js:165:18 at async /snapshot/pireporter/node_modules/@smithy/middleware-retry/dist-cjs/index.js:320:38 at async /snapshot/pireporter/node_modules/@aws-sdk/client-ec2/node_modules/@aws-sdk/middleware-logger/dist-cjs/index.js:33:22 at async /snapshot/pireporter/pireporter.js { '$fault': 'client', '$metadata': { httpStatusCode: 400, requestId: '92ce9ed2-b9f3-4315-8d44-325d9856d7f2', extendedRequestId: undefined, cfId: undefined, attempts: 1, totalRetryDelay: 0 }, Code: 'InvalidInstanceType' } [ec2-user@ip-172-31-22-201 portable]$`
aychin-aws commented 3 months ago

Hi, the fix is implemented. The new version 2.0.1 is pushed to the repo.

jayvardhancs commented 3 months ago

Hi Aychin,

I Have downloaded the new version and getting below error:

`[ec2-user@ip-172-31-22-201 portable]$ pwd /home/ec2-user/pireporter-2.0.1/portable [ec2-user@ip-172-31-22-201 portable]$ ./pireporter --create-snapshot --start-time 2024-07-02T05:00 --end-time 2024-07-02T05:30 -i pireporter-instance-1 node:internal/process/task_queues:96 runMicrotasks(); ^

TypeError: Cannot read properties of undefined (reading 'sku') at /snapshot/pireporter/pireporter.js at new Promise () at getPrices (/snapshot/pireporter/pireporter.js) at /snapshot/pireporter/pireporter.js at processTicksAndRejections (node:internal/process/task_queues:96:5) [ec2-user@ip-172-31-22-201 portable]$ `

aychin-aws commented 3 months ago

Could you please share some details, like the EC2 instance where you running the command, what is the OS type and version? In which AWS region it resides and what is configuration of the Aurora Cluster.

jayvardhancs commented 3 months ago

Hi Aychin,

Thanks for taking the issue. Please find the requested details and let me know if any more details are required.

Both the EC2 machine and Aurora Postgres instance are deployed in US-EAST-1 region. EC2 machine is deployed as Redhat Linux 9.4 and Aurora Postgres engine is 15.4. Aurora Postgres cluster is configured with one writer instance and no reader instance is deployed. Performance Insights and Enhanced Monitoring is enabled for postgres instance.

[ec2-user@ip- portable]$ cat /etc/redhat-release Red Hat Enterprise Linux release 9.4 (Plow) [ec2-user@ip- portable]$

aychin-aws commented 3 months ago

Thank you. Two more questions, does it worked previously on this host? And can you check if file exists? ls -lh /tmp/aws-pricelist.json

jayvardhancs commented 3 months ago

aws-pricelist.json

does it worked previously on this host : No, we are trying the tool for the first time. can you check if file exists : Yes, i have attached the file for reference.

aychin-aws commented 3 months ago

I cannot reproduce the issue. Just tried on new RHEL 9.4 (Plow), started new instance, attached the role and executed the portable version: [ec2-user@ip-10-1-0-235 portable]$ ./pireporter --create-snapshot --start-time 2024-07-01T012:00 --end-time 2024-07-01T12:15 -i apg-bm-2 PI snapshot created and saved into /home/ec2-user/pireporter/portable/snapshots/snapshot_apg-bm-2_20240701120000_20240701121500.json

What is the architecture of your host? Is it x86 or arm? Could you please share output of uname -a? (mask the hostname)

jayvardhancs commented 3 months ago

Hi, I will try to launch another instance and check if this could be instance specific issue. Also please find the output of uname -a from current instance.

Linux ip-***.ec2.internal 5.14.0-427.20.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 23 16:37:13 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux

jayvardhancs commented 3 months ago

Hi Aychin,

I have check with RHEL 8 and getting similar error(below shared). Can you please check if anything specific need to be configured for Aurora Postgres for the tool.

Error :

[ec2-user@ip-***** portable]$ ./pireporter --create-snapshot --start-time 2024-07-01T12:00 --end-time 2024-07-01T12:15 -i pireporter-instance-1 node:internal/process/task_queues:96 runMicrotasks(); ^

TypeError: Cannot read properties of undefined (reading 'map') at /snapshot/pireporter/pireporter.js at processTicksAndRejections (node:internal/process/task_queues:96:5) [ec2-user@ip-**** portable]$

aychin-aws commented 3 months ago

Just uploaded new version 2.0.2 Clone the repo again and try. Consider that there must be some activity in database. Without performance data we cant analyze performance. You can generate some load with pgbench for example.

jayvardhancs commented 3 months ago

Hi Aychin,

I am able to create snapshot successfully using the new version 2.0.2. Thanks for the support and time you have provided to fix the issue.

[ec2-user@ip-**** portable]$ ./pireporter --create-snapshot --start-time 2024-07-03T06:00 --end-time 2024-07-03T07:00 -i pireporter-instance-1 PI snapshot created and saved into /home/ec2-user/pireporter-2.0.2/portable/snapshots/snapshot_pireporter-instance-1_20240703060000_20240703070000.json [ec2-user@ip-*** portable]$

varun-jha commented 3 months ago

[like] Varun Jha reacted to your message:


From: jayvardhancs @.> Sent: Wednesday, July 3, 2024 7:28:35 AM To: awslabs/pireporter @.> Cc: Subscribed @.***> Subject: Re: [awslabs/pireporter] Error: InvalidInstanceType (Issue #4)

CAUTION: This message originated externally, please use caution when clicking on links or opening attachments!

Hi Aychin,

I am able to create snapshot successfully using the new version 2.0.2. Thanks for the support and time you have provided to fix the issue.

@.***** portable]$ ./pireporter --create-snapshot --start-time 2024-07-03T06:00 --end-time 2024-07-03T07:00 -i pireporter-instance-1 PI snapshot created and saved into /home/ec2-user/pireporter-2.0.2/portable/snapshots/snapshot_pireporter-instance-1_20240703060000_20240703070000.json *@*.**** portable]$

— Reply to this email directly, view it on GitHubhttps://github.com/awslabs/pireporter/issues/4#issuecomment-2205287360, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXSDEV3HZIUKKPDVYUDURB3ZKOR2HAVCNFSM6AAAAABKBQRYG6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBVGI4DOMZWGA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

aychin-aws commented 3 months ago

Great to hear that. Thank you for providing feedback. If you will have any questions or find other issues let me know. This one I will close.