AWS S3 error with MySQL dump importation in Drupal 7 - mysql

I'm getting this error:
Aws\Common\Exception\InstanceProfileCredentialsException: Error retrieving credentials from the instance profile metadata server. When you are not running inside of Amazon EC2, you must provide your AWS access key ID and secret access key in the "key" and "secret" options when creating a client or provide an instantiated Aws\Common\Credentials\CredentialsInterface object. ([curl] 28: Connection timed out after 5010 milliseconds [url] http://169.254.169.254/latest/meta-data/iam/security-credentials/) in Aws\Common\InstanceMetadata\InstanceMetadataClient->getInstanceProfileCredentials() (line 85 of /var/www/public/sites/all/libraries/awssdk2/Aws/Common/InstanceMetadata/InstanceMetadataClient.php).
In this scenario:
I'm using the AWS S3 module in Drupal 7. One bucket from S3 works for development, and the other one works for staging.
After the client add some content in staging, I try to import the new DB dump from staging to develop and the error appers, maybe is something with the image path in the new dump, the AWS credentials work for development fine, the problem is with the new DB dump.
Con someone help me please?

Looks like your instance is not able to authenticate to S3 bucket specified.
1) Set AWS Credentials in your Environment Path ( Not Recommended ). Instead you shoud assign AWS IAM Role to the Instance to give access to S3 resource.
2) You need to change S3 bucket permission such that it allows the present server to access the bucket.
Iam not sure if this is your real case. Please elaborate your question so that we can give a precise solution.
I'm not allowed to comment. so, had to post an answer.

Related

Why don't I have access to the database from aws lambda but have from a local computer with the same login data?

I created a new Mysql database in Amazon RDS, and on my local computer I get access through the console
mysql -u username -p -h test.c2nfdg67dbdpb.us-east-1.rds.amazonaws.com
Now I try to connect via Aws Lamda using python and pymysql module
rds_host = "test.c2nfdg67dbdpb.us-east-1.rds.amazonaws.com"
name = 'username'
password = 'pass'
db_name = 'dbtest'
conn = pymysql.connect(rds_host, user=name, passwd=password, db=db_name, connect_timeout=5)
and got an error ERROR] 2019-11-20T14:30:05.261Z 7b1ed2e0-03ba-4c62-9525-22d84582f (1049, "Unknown database 'dbtest'")
It seems strange that I don't use the database name at all through the local console and I get access.
p.s.I run show databases; on local console and cant see dbtest in databaselist. I was confused because when I created the new database, I entered a name, but only default databases are listed. What am I connected to then?
p.s.s
hm why DB name is undefined ?
Your code explicitly tries to connect a specific database named dbtest. It will either connect to this database or fail, contrary to your mysql client which can connect without a database selection. Clearly, the database is missing, since you verified that show databases results does not include dbtest.
Then only possible explanation is that the database was never created.
The RDS console provides the ability to create a database with default settings. That's the way I used it. But no physical database is created, only database instances.
I can't found a way to add a new database to the created instance. Now, after a few hours of troubleshooting, I recreated the new database without using the default settings and there was a point - database name entry. I added this name and everything worked out.
But here's what I don't understand is why AWS added a quick creation way, which in the end doesn't actually create a database that you can join.
If you have created the database in Amazon RDS and are able to connect to it from your local computer, it may be a connection/permission issue with your lambda. Your Lambda function may be inside a VPC subnet with no internet access. Either pull it out of the VPC or grant internet access to the Lambda function like this:
https://aws.amazon.com/premiumsupport/knowledge-center/internet-access-lambda-function/
However, if your Lambda function will be communicating with RDS instances, you should consider doing this via private channels for security purposes.
Update
A third possibility is that the database in question doesn't exist even though the asker implies that there was a successful connection to the database from his/her local computer.

Template error when mounting EFS to Elastic Beanstalk EC2 using AWS mount script

I am running into
"Service:AmazonCloudFormation, Message:Template error: every Fn::Join object requires two parameters, (1) a string delimiter and (2) a list of strings to be joined or a function that returns a list of strings (such as Fn::GetAZs) to be joined."
error when trying to deploy tomcat application with
https://github.com/awslabs/elastic-beanstalk-docs/blob/master/configuration-files/aws-provided/instance-configuration/storage-efs-mountfilesystem.config
script to mount the EFS file system to the elastic beanstalk EC2 instance.
I have been trying for a while now to resolve it. Any help is highly appreciated.
The EFS and EC2 are on the same VPC and mounting successfully works when I SSH into the EC2.
Surprisingly I dont see any ERROR logs in the CloudFormation stack either.
I finally figured out the problem. Its a very stupid mistake, in case you run into this problem here's what i was doing
The discreption says "To use this file to mount a file system that you created outside of AWS Elastic Beanstalk, replace the Ref with the resource ID" in below line
FILE_SYSTEM_ID: '{"Ref" : "FileSystem"}' so i inferred it should be
FILE_SYSTEM_ID: '{"<RESOURCE_ID>" : "FileSystem"}' no this is wrong what they actually mean is do this
FILE_SYSTEM_ID: RESOURCE_ID
I know this was stupid error but in case someone's stuck like me. Hopefully you don't do this mistake.

Connecting node to a cluster in Couchbase

I have created a bucket in my local system and I am trying to connect another node which is located in a remote server. I am able to work with the nodes separately. But I need to join these two nodes to form a cluster. Is there a way to add the remote server node into my local server by using the web UI?
When I tried to add the remote server's IP address by clicking "Add Server", I am getting the following error.
"Attention - Prepare join failed. Authentication failed. Verify username and password. Got HTTP status 401 from REST call post to http://XXX.XXX.XXX.XXX:8091/engageCluster2. Body was: []"
I used my local server's username and password. If I give that server's username and password, I get this error.
Attention - This node cannot add another node ('ns_1#XXX.XXX.XXX.XXX') because of cluster version compatibility mismatch. Cluster works in [4, 1] mode and node only supports [2, 0].
Is there a way to link them using Java API? Can someone please help me with this?

Connect a Centura client application to SQL Server

I am new to Centura application configuration
When I try opening the windows client application, which has the Centura sql.ini configuration file. I get the below error.
Can anyone please help me understand the issue?
Error code: 401
Reason: FOR SQLBASE: The specified database cannot be found. SQLBase cannot find the file named "x:\dbdir\dbname\dbname.DBS" where x:\dbdir is either the default, c:\SQLBASE, or modified with the DBDIR SQL.INI configuration keyword. In a multiuser network configuration, this error indicates that your network is working correctly, but the database system was unable to locate the specified database filename.
FOR NON-SQLBASE DATABASES: This problem can also occur with a SQLGateway when leaving out the protocol type in the SERVERNAME parameter that the client uses to communicate with the gateway (like SQLNBIOS).
For example, SERVERNAME=SERVER33,SQLQUEUE DBNAME=DB2DBMS, SQLQUEUE, SQLNBIOS
will not allow a remote client process (using SQLNBIOS on the LAN to communicate with the SQLGateway machine) to connect to the SQLGateway machine.
For SPX connectivity from DOS or MS Windows to a Unixware SQLBase Server check for the omission of the "serverpath=..." parameter in the SQL.INI file under the client section.
Remedy: Verify the database file exists. The default drive letter and dbdirname is c:\SQLBASE unless overridden with a DBDIR SQL.INI configuration keyword parameter. Verify the DBDIR keyword is not missing or pointing to a wrong database directory. Verify the DBNAME keyword is specified for the named database. Verify the SERVER keyword is not missing or conflicting with other network server names. In your CONFIG.SYS file, verify at least 40 files set with the FILES=40 parameter. If the server was being initialized while the connection was tried, retry the connection after the server has initialized. If all of the above fails, try using a different database name or try connecting to the database in single user mode at the same machine. If you can connect with a local engine it probably indicates a network configuration error exists. If you can connect with a new database name it probably indicates a previously named database was never properly initialized.

mysql host on internet using hp cloud and xeround

I am new to the 'cloud' concept I have a Java based application for data entry which runs well on my LAN.
On my LAN I install:
MySql
Configure Instance ( user name - root, pass - ******)
Dump dummy database entry_db that is in raw format
Then I have a jar executable file which when runs, displays a login screen.
I manage to successfully log in using predefined ID and PASSWORD (user - config pass - ******)
After logging in I configure(d):
Database Type
Database IP
User Name (Root)
Password ****
Database Name ( It auto selects database named entry_db)
In another window I configure(d) Network File Sharing Location:
file shared location
image path
back up data path
config file location in xml
(Note - When I select file shared location, all other files take the same path automatically)
Then I create Admin account rather than Supervisor account or operator account and login with the Admin account and I can now upload data and distribute to all operators.
Here is my problem:
I configure a cloud computer on Hp Cloud (they provide me a static ip) and then import database from xeround.com.
I now have a dns and port number and also a log in form using MY PHP CLIENT
How can I package all this to the same executable jar file to be used from anywhere?
How can I use it just like on my LAN from the web?
What is the optimal configuration for this?
I work in Xeround.
I have read your question and I wanted to point out a couple of things; you should use the DNS in the connection string where you used to put hostname/IP of the MYSQL server machine and the port number where you used to put the MySQL default port (3306).
 
Other than that you can connect from anywhere there is access to the instance. I suggest that if your jar runs in the HP cloud you create your Xeround database instance there as well (this will yield improved performance).
 
If you still need help, we will be more than happy to help you. Just send us a quick email to support#xeround.com and we'll take it from there.
Cheers,
Yuval