phishing-frenzy
phishing-frenzy copied to clipboard
ActiveRecord::StatementInvalid (Mysql2::Error: Data too long for column 'page
When cloning a website I've seen this error that prevents cloning:
ActiveRecord::StatementInvalid (Mysql2::Error: Data too long for column 'page' at row 1: INSERT INTO clones
(created_at
, name
, page
, status
, updated_at
, url
) VALUES ('2015-01-08 10:15:42', 'XYZ', '\n\r\n
Weird because the type of "page" column is actually text (not string) in the schema definition of "clones", so this shouldn't happen.
Could you jump into your rails console and ensure the column type is applied as a text. Run the following command from rails console.
> Clones.columns_hash["page"].type
Also there is a pretty good article here that explains some of the differences between rails and mysql: http://stackoverflow.com/questions/24310178/rails-4-migration-mysql2error-data-too-long-for-column-xxxx
I will have a look at the link, but so far it looks like it is indeed correct:
2.1.5 :004 > Clone.columns_hash["page"].type => :text
Also having same problem at my environment:
ActiveRecord::StatementInvalid in ClonesController#create
Mysql2::Error: Data too long for column 'page' at row 1: INSERT INTO clones
We will be removing the website cloning func from future releases.