phishing-frenzy icon indicating copy to clipboard operation
phishing-frenzy copied to clipboard

ActiveRecord::StatementInvalid (Mysql2::Error: Data too long for column 'page

Open antisnatchor opened this issue 10 years ago • 4 comments

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

\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

Weird because the type of "page" column is actually text (not string) in the schema definition of "clones", so this shouldn't happen.

antisnatchor avatar Jan 08 '15 10:01 antisnatchor

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

zeknox avatar Jan 08 '15 14:01 zeknox

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 

antisnatchor avatar Jan 08 '15 15:01 antisnatchor

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

y2h4ck avatar Jul 17 '15 14:07 y2h4ck

We will be removing the website cloning func from future releases.

zeknox avatar Nov 23 '16 02:11 zeknox