Error thrown when attempting to install Magento on cPanel - hosting

As stated in title, when trying to install Magento through Installatron on cPanel it throws an error everytime saying:-
"A database query has failed. Is the entered database information correct? Does the account have available disk space?
Technical information:
method = query
arguments = array ( 0 => 'SELECT user_id FROM mg_admin_user WHERE is_active=\'1\' ORDER BY user_id ASC LIMIT 1', 1 => NULL, 2 => 'user_id',)"

Related

How to access a single field of the logstash metadata event?

I am using logastash 7.6 with the output-jdbc plugin, but I get an error and I understand that it is because in the event it sends me all the fields to be indexed that are part of #metadata.
Probe just putting the event name without # and it works for me.
How can I get a single field within a #metada set?
ERROR:
ERROR logstash.outputs.jdbc - JDBC - Exception. Not retrying {:exception=>#, :statement=>"UPDATE table SET estate = 'P' WHERE codigo = ? ", :event=>"{\"properties\":{\"rangoAltura1\":null,\"rangoAltura2\":null,\"codigo\":\"DB_001\",\"rangoAltura3\":null,\"descrip\":\"CARLOS PEREZ\",\"codigo\":\"106\",\"rangoAltura5\":null,\"active\":true},\"id\":\"DB_001_555\"}"}
My .conf:
statement => ["UPDATE table SET estate = 'A' WHERE entidad = ? ","%{[#metadata][miEntidad]}"]
{[#metadata][miEntidad]} -----> map['entidad_temp'] = event.get('entidad')
According to the output jdbc plugin README you have it set correctly/
Maybe try the following as a work-around:
statement => ["UPDATE table SET estate = 'A' WHERE entidad = ? ","[#metadata][miEntidad]"]

Google ad manager try to read revenue per hour fails on ReportError.COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS

I have a simple script that fetch data from google ad manager.
Everything is working pretty fine, Now I am trying to read the same data but instead of date aggregation, I am trying by day and hour.
I get the following error:
AdManagerApi::V201905::ReportService::ApiException: [ReportError.COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS # columns; trigger:'TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE']
My report query in ruby is:
# Create report query.
report_query = {
:date_range_type => 'CUSTOM_DATE',
:start_date => AdManagerApi::AdManagerDate.new(#ad_manager, start_date).to_h,
:end_date => AdManagerApi::AdManagerDate.new(#ad_manager, end_date).to_h,
:dimensions => ['DAY', 'HOUR', 'CUSTOM_CRITERIA'],
:columns => ['TOTAL_LINE_ITEM_LEVEL_CPM_AND_CPC_REVENUE']
}
I took the full example from here
I am pretty new with the google ad manager api, I will appreciate any suggestion.
Try removing CUSTOM_CRITERIA from the :dimensions list

How to get order username and provisionDate for all SoftLayer machines using Ruby?

Using Ruby I'm making a call like:
client = SoftLayer::Client.new(:username => user, :api_key => api_key, :timeout => 999999)
client['Account'].object_mask("mask[id, hostname, fullyQualifiedDomainName, provisionDate, datacenter[name], billingItem[recurringFee, associatedChildren[recurringFee], orderItem[description, order[userRecord[username], id]]], tagReferences[tagId, tag[name]], primaryIpAddress, primaryBackendIpAddress]").getHardware
But only some machines return a provisionDate and only some return orderItem information. How can I consistently get this information for each machine? What would cause one machine to return this data and another machine to not?
Example output:
{"fullyQualifiedDomainName"=>"<removed_by_me>",
"hostname"=>"<removed_by_me>",
"id"=>167719,
"provisionDate"=>"",
"primaryBackendIpAddress"=>"<removed_by_me>",
"primaryIpAddress"=>"<removed_by_me>",
"billingItem"=>
{"recurringFee"=>"506.78",
"associatedChildren"=>
[<removed_by_me>]},
"datacenter"=>{"name"=>"dal09"},
"tagReferences"=>
[{"tagId"=>139415, "tag"=>{"name"=>"<removed_by_me>"}},
{"tagId"=>139417, "tag"=>{"name"=>"<removed_by_me>"}},
{"tagId"=>140549, "tag"=>{"name"=>"<removed_by_me>"}}]}
To be clear, most machines return this data so I'm trying to understand why some do not.
Please see the following provisioning steps, below is a little flow to consider:
1. Order a Server
Result:
* An orderId is assigned to the server
* The createDate has a new value
* activeTransaction value is = Null
* provisionDate value is = Null
2. The order is approved
Result:
* activeTransaction value is <> Null
* provisionDate value = Null
3. Server is already provisioned
Result:
* activeTransaction value is = Null
* provisionDate value has a New value
* billingItem property has a new value
To see if your machines have still ”activeTransaction”, please execute:
https://[username]:[apikey]#api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/[server_id]/getActiveTransaction
Method: GET
Now, after reviewing your example response, this server had some problems when completing the provisioning; for that reason this step was completed manually but the provisionDate was not set for any reason(please open a ticket if you want that the provisionDate can be set) . This is a special case. I can see that another server has a similar behavior. But the other servers that don’t have provisionDate, have still ”activeTransaction<>null” (it means that these server are not provisioned yet).
EDIT:
Other property can help you to know that your machine has been already provisioned although other kind of transaction is being executed, is “hardwareStatus”, it should have “ACTIVE” value.
https://[username]:[apikey]#api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectMask=mask[id, hostname, fullyQualifiedDomainName, provisionDate,hardwareStatus]
Method: GET
The response should be something like this:
{
"fullyQualifiedDomainName": "myhostname.softlayer.com"
"hostname": " myhostname"
"id": 1234567
"provisionDate": "2015-06-29T00:21:39-05:00"
"hardwareStatus": {
"id": 5
"status": "ACTIVE"
}

brainspec/enumerize throwing mysql error for default value

I'm working on a Rails 4 app, and I've begun using brainspec/enumerize gem. I have an integer value in the database, column status and would like to enumerate it in my model.
Below you can see the snippet I use to set it up. Unfortunately, in my tests (which were all passing previously) it complains about creating a Partner due to not being able to save the row. Can't assign a default status of NULL. Not sure where it's getting NULL from, as the database itself (MySQL) is set up for a default value of 0 and as you can see from below, the back-end side instructs a default of 4 or :incomplete.
enumerize :status, in: [
:pending, # 0 account has a pending billing request (but is not yet open)
:active, # 1 account has an active base subscription
:suspended, # 2 account has been suspended (e.g. after a base subscription decline)
:expired, # 3 base subscription has expired
:incomplete, # 4 partner application process incomplete
:closed, # 5 account has been permanently closed
:cancelled # 6 account has been cancelled by user (but is still unexpired)
], default: :incomplete
Here is the ActiveRecord/MySQL error.
PartnerTest#test_create_with_nested_attributes:
ActiveRecord::StatementInvalid: Mysql2::Error: Column 'status' cannot be null: UPDATE `partner` SET `primary_contact_id` = 3, `status` = NULL WHERE `partner`.`id` = 3
test/models/partner_test.rb:9:in `block in <class:PartnerTest>'
Furthermore, I know that the default value (:incomplete) is being picked up by Enumerize. If I throw gibberish into the default (default: :asdoiasoas) it baulks.
I'm using the master/branch so that it works with Rails 4.
Gemfile
gem 'enumerize', :github => 'brainspec/enumerize'
According to brainspec/enumerize README, you should provide an integer value for each status, like:
enumerize :status, in: {
pending: 0, # 0 account has a pending billing request (but is not yet open)
active: 1, # 1 account has an active base subscription
suspended: 2, # 2 account has been suspended (e.g. after a base subscription decline)
expired: 3, # 3 base subscription has expired
incomplete: 4 # 4 partner application process incomplete
# And so on...
}, default: :incomplete
As you provided only the key but not the value, it was setting it to nil/NULL.

500 - No valid database connection:MySQL server has gone away

I have a website under the joomla in one of the hosting servers. It was working fine until yesterday. But starting from yesterday when I open the web site it gives me following error:
500 - No valid database connection:MySQL server has gone away SQL=SELECT a.*, CASE WHEN CHAR_LENGTH(a.alias) THEN CONCAT_WS(":", a.id, a.alias) ELSE a.id END as slug, CASE WHEN CHAR_LENGTH(cc.alias) THEN CONCAT_WS(":", cc.id, cc.alias) ELSE cc.id END as catslug FROM jos_content AS a INNER JOIN jos_categories AS cc ON cc.id = a.catid INNER JOIN jos_sections AS s ON s.id = a.sectionid WHERE a.state = 1 AND ( a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2012-03-04 17:59:41' ) AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2012-03-04 17:59:41' ) AND s.id > 0 AND a.access <= 0 AND cc.access <= 0 AND s.access <= 0 AND s.published = 1 AND cc.published = 1 ORDER BY a.created DESC LIMIT 0, 5
Or sometimes it just says :
Internal Server Error.
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#mysite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
What could be wrong with it? Or it is the host center who has a problem?
Change the database type from mysql to mysqli.

Resources