By using AWS re:Post, you agree to the Terms of Use
/Database/

Database

AWS features the broadest selection of purpose-built databases for all of your application needs. With 15+ database engines to choose from, hundreds of thousands of customers rely on AWS databases to build use case driven, highly scalable, and distributed applications.

Recent questions

see all
1/18

Aurora MySQL crashing randomly

I am on my third Aurora cluster that is randomly failing, leading my application to die. AWS support team didn't answer my support case. Engine version: 8.0.mysql_aurora.3.01.0 ``` /etc/rds/oscar-start-cmd: line 39: 2687 Killed /rdsdbbin/oscar/bin/mysqld --core-file --innodb_shared_buffer_pool_uses_huge_pages='1' "$@" grover/runtime/overlay.cpp:2270: Assertion failed: err == 0 Stack trace: /rdsdbbin/oscar/bin/mysqld() [0x2be2f08] /rdsdbbin/oscar/bin/mysqld(_Z27log_grover_pid_from_page_nomm+0x1d) [0x2850bdd] <inline> (in buf_page_t::set_grover_vol_pid(unsigned long, unsigned long) at /local/p4clients/pkgbuild-FRTaI/workspace/src/OscarMysql80/storage/innobase/include/ut0lock_free_hash.h:638) /rdsdbbin/oscar/bin/mysqld() [0x2597395] (in buf_page_init at /local/p4clients/pkgbuild-FRTaI/workspace/src/OscarMysql80/storage/innobase/buf/buf0buf.cc:6645) /rdsdbbin/oscar/bin/mysqld(_Z22buf_page_init_for_readP7dberr_tmRK9page_id_tRK11page_size_tm+0x2e0) [0x25a3cf0] /rdsdbbin/oscar/bin/mysqld(_Z17buf_read_page_lowP7dberr_tbmmRK9page_id_tRK11page_size_tbbb+0x91) [0x25c6c91] /rdsdbbin/oscar/bin/mysqld(_Z13buf_read_pageRK9page_id_tRK11page_size_tb+0x3c) [0x25c76bc] /rdsdbbin/oscar/bin/mysqld(_ZN9Buf_fetchI16Buf_fetch_normalE9read_pageEv+0x27) [0x2597ce7] /rdsdbbin/oscar/bin/mysqld(_ZN16Buf_fetch_normal3getERP11buf_block_t+0xb2) [0x259ed82] /rdsdbbin/oscar/bin/mysqld(_ZN9Buf_fetchI16Buf_fetch_normalE11single_pageEv+0x4e) [0x25a654e] /rdsdbbin/oscar/bin/mysqld(_Z16buf_page_get_genRK9page_id_tRK11page_size_tmP11buf_block_t10Page_fetchPKcmP5mtr_tb+0x1d9) [0x25a75a9] /rdsdbbin/oscar/bin/mysqld() [0x2637bc1] /rdsdbbin/oscar/bin/mysqld(_Z28fseg_alloc_free_page_generalPhjhmP5mtr_tS1_+0x1d0) [0x2639160] /rdsdbbin/oscar/bin/mysqld(_Z14btr_page_allocP12dict_index_tjhmP5mtr_tS2_+0xd5) [0x256ecc5] /rdsdbbin/oscar/bin/mysqld(_ZN3lob14alloc_lob_pageEP12dict_index_tP5mtr_tjb+0x216) [0x28bb676] /rdsdbbin/oscar/bin/mysqld(_ZN3lob12first_page_t5allocEP5mtr_tb+0x24) [0x28ab0c4] /rdsdbbin/oscar/bin/mysqld(_ZN3lob6insertEPNS_13InsertContextEP5trx_tRNS_5ref_tEP15big_rec_field_tm+0x14f) [0x28b78df] /rdsdbbin/oscar/bin/mysqld(_ZN3lob31btr_store_big_rec_extern_fieldsEP5trx_tP10btr_pcur_tPK5upd_tPmPK9big_rec_tP5mtr_tNS_6opcodeE+0xb16) [0x26edbb6] /rdsdbbin/oscar/bin/mysqld() [0x277331d] /rdsdbbin/oscar/bin/mysqld(_Z29row_ins_clust_index_entry_lowjmP12dict_index_tmP8dtuple_tP10btr_pcur_tP9que_thr_tb+0x646) [0x2774906] /rdsdbbin/oscar/bin/mysqld(_Z25row_ins_clust_index_entryP12dict_index_tP8dtuple_tP10btr_pcur_tP9que_thr_tb+0xe8) [0x277b158] /rdsdbbin/oscar/bin/mysqld(_Z12row_ins_stepP9que_thr_t+0x274) [0x277b7d4] /rdsdbbin/oscar/bin/mysqld() [0x278ca73] /rdsdbbin/oscar/bin/mysqld(_ZN11ha_innobase9write_rowEPh+0x226) [0x268fac6] /rdsdbbin/oscar/bin/mysqld(_ZN7handler12ha_write_rowEPh+0x177) [0x14a4867] /rdsdbbin/oscar/bin/mysqld(_Z12write_recordP3THDP5TABLEP9COPY_INFOS4_+0x5d4) [0x172e3d4] /rdsdbbin/oscar/bin/mysqld(_ZN21Sql_cmd_insert_values13execute_innerEP3THD+0xbaf) [0x173018f] /rdsdbbin/oscar/bin/mysqld(_ZN11Sql_cmd_dml7executeEP3THD+0x6cc) [0x119905c] /rdsdbbin/oscar/bin/mysqld(_Z30mysql_execute_command_internalP3THDb+0x1143) [0x1139f33] /rdsdbbin/oscar/bin/mysqld(_Z21mysql_execute_commandP3THDb+0x17b) [0x113d31b] /rdsdbbin/oscar/bin/mysqld(_Z20dispatch_sql_commandP3THDP12Parser_state+0x351) [0x113df91] 21:03:27 UTC - mysqld got signal 6 ; Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware. Thread pointer: 0x14652cf4e000 Attempting backtrace. You can use the following information to find out where mysqld died. If you see no messages after this, something went terribly wrong... stack_bottom = 1465869fba9f thread_stack 0x40000 /rdsdbbin/oscar/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x2d) [0x246ac4d] /rdsdbbin/oscar/bin/mysqld(handle_fatal_signal+0x532) [0x1310292] /lib64/libpthread.so.0(+0x117df) [0x147cc9b707df] /lib64/libc.so.6(gsignal+0x110) [0x147cc8ef3c20] /lib64/libc.so.6(abort+0x147) [0x147cc8ef50c7] /rdsdbbin/oscar/bin/mysqld() [0xf963d7] /rdsdbbin/oscar/bin/mysqld() [0x2dba17a] /rdsdbbin/oscar/bin/mysqld() [0x2dba333] /rdsdbbin/oscar/bin/mysqld() [0x2be2f08] /rdsdbbin/oscar/bin/mysqld(log_grover_pid_from_page_no(unsigned long, unsigned long)+0x1d) [0x2850bdd] /rdsdbbin/oscar/bin/mysqld() [0x2597395] /rdsdbbin/oscar/bin/mysqld(buf_page_init_for_read(dberr_t*, unsigned long, page_id_t const&, page_size_t const&, unsigned long)+0x2e0) [0x25a3cf0] /rdsdbbin/oscar/bin/mysqld(buf_read_page_low(dberr_t*, bool, unsigned long, unsigned long, page_id_t const&, page_size_t const&, bool, bool, bool)+0x91) [0x25c6c91] /rdsdbbin/oscar/bin/mysqld(buf_read_page(page_id_t const&, page_size_t const&, bool)+0x3c) [0x25c76bc] /rdsdbbin/oscar/bin/mysqld(Buf_fetch<Buf_fetch_normal>::read_page()+0x27) [0x2597ce7] /rdsdbbin/oscar/bin/mysqld(Buf_fetch_normal::get(buf_block_t*&)+0xb2) [0x259ed82] /rdsdbbin/oscar/bin/mysqld(Buf_fetch<Buf_fetch_normal>::single_page()+0x4e) [0x25a654e] /rdsdbbin/oscar/bin/mysqld(buf_page_get_gen(page_id_t const&, page_size_t const&, unsigned long, buf_block_t*, Page_fetch, char const*, unsigned long, mtr_t*, bool)+0x1d9) [0x25a75a9] /rdsdbbin/oscar/bin/mysqld() [0x2637bc1] /rdsdbbin/oscar/bin/mysqld(fseg_alloc_free_page_general(unsigned char*, unsigned int, unsigned char, unsigned long, mtr_t*, mtr_t*)+0x1d0) [0x2639160] /rdsdbbin/oscar/bin/mysqld(btr_page_alloc(dict_index_t*, unsigned int, unsigned char, unsigned long, mtr_t*, mtr_t*)+0xd5) [0x256ecc5] /rdsdbbin/oscar/bin/mysqld(lob::alloc_lob_page(dict_index_t*, mtr_t*, unsigned int, bool)+0x216) [0x28bb676] /rdsdbbin/oscar/bin/mysqld(lob::first_page_t::alloc(mtr_t*, bool)+0x24) [0x28ab0c4] /rdsdbbin/oscar/bin/mysqld(lob::insert(lob::InsertContext*, trx_t*, lob::ref_t&, big_rec_field_t*, unsigned long)+0x14f) [0x28b78df] /rdsdbbin/oscar/bin/mysqld(lob::btr_store_big_rec_extern_fields(trx_t*, btr_pcur_t*, upd_t const*, unsigned long*, big_rec_t const*, mtr_t*, lob::opcode)+0xb16) [0x26edbb6] /rdsdbbin/oscar/bin/mysqld() [0x277331d] /rdsdbbin/oscar/bin/mysqld(row_ins_clust_index_entry_low(unsigned int, unsigned long, dict_index_t*, unsigned long, dtuple_t*, btr_pcur_t*, que_thr_t*, bool)+0x646) [0x2774906] /rdsdbbin/oscar/bin/mysqld(row_ins_clust_index_entry(dict_index_t*, dtuple_t*, btr_pcur_t*, que_thr_t*, bool)+0xe8) [0x277b158] /rdsdbbin/oscar/bin/mysqld(row_ins_step(que_thr_t*)+0x274) [0x277b7d4] /rdsdbbin/oscar/bin/mysqld() [0x278ca73] /rdsdbbin/oscar/bin/mysqld(ha_innobase::write_row(unsigned char*)+0x226) [0x268fac6] /rdsdbbin/oscar/bin/mysqld(handler::ha_write_row(unsigned char*)+0x177) [0x14a4867] /rdsdbbin/oscar/bin/mysqld(write_record(THD*, TABLE*, COPY_INFO*, COPY_INFO*)+0x5d4) [0x172e3d4] /rdsdbbin/oscar/bin/mysqld(Sql_cmd_insert_values::execute_inner(THD*)+0xbaf) [0x173018f] /rdsdbbin/oscar/bin/mysqld(Sql_cmd_dml::execute(THD*)+0x6cc) [0x119905c] /rdsdbbin/oscar/bin/mysqld(mysql_execute_command_internal(THD*, bool)+0x1143) [0x1139f33] /rdsdbbin/oscar/bin/mysqld(mysql_execute_command(THD*, bool)+0x17b) [0x113d31b] /rdsdbbin/oscar/bin/mysqld(dispatch_sql_command(THD*, Parser_state*)+0x351) [0x113df91] /rdsdbbin/oscar/bin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x1b39) [0x113ff99] /rdsdbbin/oscar/bin/mysqld(do_command(THD*)+0x1c6) [0x1140f46] /rdsdbbin/oscar/bin/mysqld(THD_task::process_connection()+0x134) [0x12fcfc4] /rdsdbbin/oscar/bin/mysqld(Thread_pool::worker_loop()+0x180) [0x12fbc80] /rdsdbbin/oscar/bin/mysqld(Thread_pool::worker_launch(void*)+0x20) [0x12fbea0] /rdsdbbin/oscar/bin/mysqld() [0x296c531] /lib64/libpthread.so.0(+0x740a) [0x147cc9b6640a] /lib64/libc.so.6(clone+0x3e) [0x147cc8fad09e] Trying to get some variables. Some pointers may be invalid and cause the dump to abort. Query (1479bc268028): [omitted] Connection ID (thread ID): 45980 Status: NOT_KILLED The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains information that should help you find out what is causing the crash. aurora backtrace compare flag : 1 Writing a core file [...] ```
0
answers
0
votes
5
views
tobias
asked 2 days ago

Lambda Execution Function Issue For RDS Reboot

Greetings, I created a simple function taking as reference the basic Lambda in Python to start/stop RDS from here: [https://aws.amazon.com/es/blogs/database/schedule-amazon-rds-stop-and-start-using-aws-lambda/]() But I changed it for reboot purposes, so my Python code is the following: ``` # Lambda for RDS reboot given a REGION, KEY and VALUE import boto3 import os import sys import time from datetime import datetime, timezone from time import gmtime, strftime # REGION: the rds region # KEY - VALUE: the KEY and VALUE from RDS tag def reboot_rds(): region = os.environ["REGION"] key = os.environ["KEY"] value = os.environ["VALUE"] client = boto3.client("rds", region_name=region) response = client.describe_db_instances() v_readReplica = [] for i in response["DBInstances"]: readReplica = i["ReadReplicaDBInstanceIdentifiers"] v_readReplica.extend(readReplica) for i in response["DBInstances"]: # Check if the RDS is Aurora if i["Engine"] not in ["aurora-mysql", "aurora-postgresql"]: # Check if RDS is a replica instance if ( i["DBInstanceIdentifier"] not in v_readReplica and len(i["ReadReplicaDBInstanceIdentifiers"]) == 0 ): arn = i["DBInstanceArn"] resp2 = client.list_tags_for_resource(ResourceName=arn) # Check tag if 0 == len(resp2["TagList"]): print("Instance {0} tag value is not correct".format(i["DBInstanceIdentifier"])) else: for tag in resp2["TagList"]: # if tag values match if tag["Key"] == key and tag["Value"] == value: if i["DBInstanceStatus"] == "available": client.reboot_db_instance( DBInstanceIdentifier=i["DBInstanceIdentifier"], ForceFailover=False, ) print("Rebooting RDS {0}".format(i["DBInstanceIdentifier"])) elif i["DBInstanceStatus"] == "rebooting": print( "Instance RDS {0} is already rebooting".format( i["DBInstanceIdentifier"] ) ) elif i["DBInstanceStatus"] == "creating": print( "Instance RDS {0} is on creation, try later".format( i["DBInstanceIdentifier"] ) ) elif i["DBInstanceStatus"] == "modifying": print( "Instance RDS {0} {0} is modifying, try later".format( i["DBInstanceIdentifier"] ) ) elif i["DBInstanceStatus"] == "stopped": print( "Cannot reboot RDS {0} it is already stopped".format( i["DBInstanceIdentifier"] ) ) elif i["DBInstanceStatus"] == "starting": print( "Instance RDS {0} is starting, try later".format( i["DBInstanceIdentifier"] ) ) elif i["DBInstanceStatus"] == "stopping": print( "Instance RDS {0} is stopping, try later.".format( i["DBInstanceIdentifier"] ) ) elif tag["Key"] != key and tag["Value"] != value: print( "Tag values {0} doesn't match".format(i["DBInstanceIdentifier"]) ) elif len(tag["Key"]) == 0 or len(tag["Value"]) == 0: print("Error {0}".format(i["DBInstanceIdentifier"])) else: print( "Instance RDS {0} is on a different state, check the RDS monitor for more info".format( i["DBInstanceIdentifier"] ) ) def lambda_handler(event, context): reboot_rds() ``` My environment variables: | Key| Value | | --- | --- | | KEY | tmptest | | REGION | us-east-1e | | VALUE| reboot| And finally my event named 'Test' `{ "key1": "tmptest", "key2": "us-east-1e", "key3": "reboot" }` I checked the indentation of my code before execute it and its fine, but in execution of my test event I got the following output: `{ "errorMessage": "2022-01-14T14:50:22.245Z b8d0dc59-714d-4543-8651-b5a2532dfe8e Task timed out after 1.00 seconds" }` ``` START RequestId: b8d0dc59-714d-4543-8651-b5a2532dfe8e Version: $LATEST END RequestId: b8d0dc59-714d-4543-8651-b5a2532dfe8e REPORT RequestId: b8d0dc59-714d-4543-8651-b5a2532dfe8e Duration: 1000.76 ms Billed Duration: 1000 ms Memory Size: 128 MB Max Memory Used: 65 MB Init Duration: 243.69 ms 2022-01-14T14:50:22.245Z b8d0dc59-714d-4543-8651-b5a2532dfe8e Task timed out after 1.00 seconds ``` Also my test RDS has the correct tag values in order to get the reboot action but nothing, until now I cannot reboot my instance with my Lambda function. Any clue what's wrong with my code? Maybe some additional configuration issue or something in my code is not correct, I don't know. I'd appreciate if someone can give a hand with this. **UPDATE 2022/01/15** As suggestion of **Brettski@AWS** I increased the time from 1 second to 10 then I got the following error message: ``` { "errorMessage": "Could not connect to the endpoint URL: \"https://rds.us-east-1e.amazonaws.com/\"", "errorType": "EndpointConnectionError", "requestId": "b2bb3840-42a2-4220-84b4-642d17d7a9e6", "stackTrace": [ " File \"/var/task/lambda_function.py\", line 103, in lambda_handler\n reiniciar_rds()\n", " File \"/var/task/lambda_function.py\", line 16, in reiniciar_rds\n response = client.describe_db_instances()\n", " File \"/var/runtime/botocore/client.py\", line 386, in _api_call\n return self._make_api_call(operation_name, kwargs)\n", " File \"/var/runtime/botocore/client.py\", line 691, in _make_api_call\n http, parsed_response = self._make_request(\n", " File \"/var/runtime/botocore/client.py\", line 711, in _make_request\n return self._endpoint.make_request(operation_model, request_dict)\n", " File \"/var/runtime/botocore/endpoint.py\", line 102, in make_request\n return self._send_request(request_dict, operation_model)\n", " File \"/var/runtime/botocore/endpoint.py\", line 136, in _send_request\n while self._needs_retry(attempts, operation_model, request_dict,\n", " File \"/var/runtime/botocore/endpoint.py\", line 253, in _needs_retry\n responses = self._event_emitter.emit(\n", " File \"/var/runtime/botocore/hooks.py\", line 357, in emit\n return self._emitter.emit(aliased_event_name, **kwargs)\n", " File \"/var/runtime/botocore/hooks.py\", line 228, in emit\n return self._emit(event_name, kwargs)\n", " File \"/var/runtime/botocore/hooks.py\", line 211, in _emit\n response = handler(**kwargs)\n", " File \"/var/runtime/botocore/retryhandler.py\", line 183, in __call__\n if self._checker(attempts, response, caught_exception):\n", " File \"/var/runtime/botocore/retryhandler.py\", line 250, in __call__\n should_retry = self._should_retry(attempt_number, response,\n", " File \"/var/runtime/botocore/retryhandler.py\", line 277, in _should_retry\n return self._checker(attempt_number, response, caught_exception)\n", " File \"/var/runtime/botocore/retryhandler.py\", line 316, in __call__\n checker_response = checker(attempt_number, response,\n", " File \"/var/runtime/botocore/retryhandler.py\", line 222, in __call__\n return self._check_caught_exception(\n", " File \"/var/runtime/botocore/retryhandler.py\", line 359, in _check_caught_exception\n raise caught_exception\n", " File \"/var/runtime/botocore/endpoint.py\", line 200, in _do_get_response\n http_response = self._send(request)\n", " File \"/var/runtime/botocore/endpoint.py\", line 269, in _send\n return self.http_session.send(request)\n", " File \"/var/runtime/botocore/httpsession.py\", line 373, in send\n raise EndpointConnectionError(endpoint_url=request.url, error=e)\n" ] } ``` It's strange because my VPC configuration is fine, it's the same VPC of my RDS, its zone and the same security group. What else have I to consider in order to make my code work properly?
2
answers
0
votes
5
views
TEENEESE
asked 2 days ago

Dynamodb: Deleting all items & Read Write Capacity Query

Hi, I have a use case where I get about 20 links at a fixed time each day and want to store them in DynamoDb for analysis using AWS Lambda. I want to delete all prior stored links and then store new ones. I could not find a way to delete all items in Dynamodb like SQL so I am dropping the table and then re-creating it. I am not sure if this is the right way to go about it. Also, wanted to get inputs on required provisioned capacity for this exercise. I will have only about 20-30 rows with 5 columns. Below is my code which is currently working but wanted to get inputs if this is how this should be implemented and if there are AWS cost implications for this - I am new to AWS and currently on AWS Free Tier. > def getLinks&Store(): links = getLinks() dynamodb = boto3.resource('dynamodb', region_name = 'us-east-2') try: oldTable = dynamodb.Table('Links_Dynamic') if oldTable is not None: client = boto3.client('dynamodb') client.delete_table(TableName='Links_Dynamic') waiter = client.get_waiter('table_not_exists') waiter.wait(TableName='Links_Dynamic') except: print('Old Table is not available') linksDynamicTable = buildNewTable(dynamodb) for link in link: linksDynamicTable.put_item(Item= {'link': link}) > def buildNewTable(dynamodb): table = dynamodb.create_table( TableName="Livestream_Dynamic", KeySchema=[ { 'AttributeName': 'LivestreamID', 'KeyType': 'HASH' #Partition key } ], AttributeDefinitions=[ { 'AttributeName': 'LivestreamID', 'AttributeType': 'S' }, ], ProvisionedThroughput= { 'ReadCapacityUnits': 10, 'WriteCapacityUnits': 10 } , ) table.meta.client.get_waiter('table_exists').wait(TableName='Livestream_Dynamic') return table Regards, Dbeings
2
answers
0
votes
9
views
dbeing
asked 4 days ago

Popular users

see all
1/18

Learn AWS faster by following popular topics

1/1