Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

Moderators: martimiz, UncleCheese, Sean, Ed, biapar, Willr, Ingo, swaiba

uploadify problem <h1> bad request (Invalid hostname) </h1>


Go to End


3226 Views

Avatar
ravik

Community Member, 10 Posts

2 January 2013 at 7:07pm

hi everyone,

I am using silverstripe 2.4.7 it is working fine, The thing is from last one month uploadify module is working fine in my localhost,
but suddenly it giving error like "<h1> bad request (Invalid hostname) </h1>" in localhost.

after that i enable the firefox firebug, so now i am getting response from firebug is

ERROR [User Error]: Couldn't run query:
SELECT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."Sort", "File"."ShowInSearch", "File"."SortOrder", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName"
FROM "File"
WHERE ("File"."ID" IN (<h1>Bad Request (Invalid Hostname)</h1>))
ORDER BY "SortOrder" ASC

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<h1>Bad Request (Invalid Hostname)</h1>)) ORDER BY "SortOrder" ASC' at line 1
IN GET /nesso/index.php/admin/assets/EditForm/field/Files/UploadifyForm/field/UploadedFiles/refresh?SecurityID=6b50d9fb8fd164f81ab57b19593446690749745d&ctf[Files][start]=0&ctf[Files][per_page]=10&ctf[Files][showall]=0&ctf[Files][sort]=SortOrder&ctf[Files][sort_dir]=&ctf[Files][search]=&ctf[Files][filter]=&ctf[Files][view]=&FileIDs=%3Ch1%3EBad+Request+(Invalid+Hostname)%3C%2Fh1%3E
Line 525 in /var/www/nesso/sapphire/core/model/MySQLDatabase.php

Source
======
516: }
517:
518: function databaseError($msg, $errorLevel = E_USER_ERROR) {
519: // try to extract and format query
520: if(preg_match('/Couldn\'t run query: ([^\|]*)\|\s*(.*)/', $msg, $matches)) {
521: $formatter = new SQLFormatter();
522: $msg = "Couldn't run query: \n" . $formatter->formatPlain($matches[1]) . "\n\n" . $matches[2];
523: }
524:
* 525: user_error($msg, $errorLevel);
526: }
527:
528: /**
529: * Return a boolean type-formatted string
530: *
531: * @param array $values Contains a tokenised list of info about this data type

Trace
=====
<ul>user_error(Couldn't run query:
SELECT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."Sort", "File"."ShowInSearch", "File"."SortOrder", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName"
FROM "File"
WHERE ("File"."ID" IN (<h1>Bad Request (Invalid Hostname)</h1>))
ORDER BY "SortOrder" ASC

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<h1>Bad Request (Invalid Hostname)</h1>)) ORDER BY "SortOrder" ASC' at line 1,256)
line 525 of MySQLDatabase.php

MySQLDatabase->databaseError(Couldn't run query: SELECT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."Sort", "File"."ShowInSearch", "File"."SortOrder", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" WHERE ("File"."ID" IN (<h1>Bad Request (Invalid Hostname)</h1>)) ORDER BY "SortOrder" ASC | You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<h1>Bad Request (Invalid Hostname)</h1>)) ORDER BY "SortOrder" ASC' at line 1,256)
line 123 of MySQLDatabase.php

MySQLDatabase->query(SELECT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."Sort", "File"."ShowInSearch", "File"."SortOrder", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" WHERE ("File"."ID" IN (<h1>Bad Request (Invalid Hostname)</h1>)) ORDER BY "SortOrder" ASC,256)
line 129 of DB.php

DB::query(SELECT "File"."ClassName", "File"."Created", "File"."LastEdited", "File"."Name", "File"."Title", "File"."Filename", "File"."Content", "File"."Sort", "File"."ShowInSearch", "File"."SortOrder", "File"."ParentID", "File"."OwnerID", "File"."ID", CASE WHEN "File"."ClassName" IS NOT NULL THEN "File"."ClassName" ELSE 'File' END AS "RecordClassName" FROM "File" WHERE ("File"."ID" IN (<h1>Bad Request (Invalid Hostname)</h1>)) ORDER BY "SortOrder" ASC,256)
line 404 of SQLQuery.php

SQLQuery->execute()
line 761 of File.php

File->instance_get("File"."ID" IN (<h1>Bad Request (Invalid Hostname)</h1>),,,,DataObjectSet)
line 2714 of DataObject.php

DataObject::get(File,"File"."ID" IN (<h1>Bad Request (Invalid Hostname)</h1>))
line 182 of MultipleFileUploadField.php

MultipleFileUploadField->Files()
line 369 of ViewableData.php

ViewableData->obj(Files,,,1,)
line 411 of ViewableData.php

ViewableData->cachedCall(Files,)
line 424 of ViewableData.php

ViewableData->hasValue(Files)
line 11 of .cache.uploadify.templates.Includes.AttachedFiles.ss

include(/tmp/silverstripe-cache-var-www-nesso/.cache.uploadify.templates.Includes.AttachedFiles.ss)
line 429 of SSViewer.php

SSViewer->process(MultipleFileUploadField)
line 342 of ViewableData.php

ViewableData->renderWith(AttachedFiles)
line 128 of MultipleFileUploadField.php

MultipleFileUploadField->refresh(SS_HTTPRequest)
line 143 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 161 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 161 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 161 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 161 of RequestHandler.php

RequestHandler->handleRequest(SS_HTTPRequest)
line 147 of Controller.php

Controller->handleRequest(SS_HTTPRequest)
line 282 of Director.php

Director::handleRequest(SS_HTTPRequest,Session)
line 125 of Director.php

Director::direct(admin/assets/EditForm/field/Files/UploadifyForm/field/UploadedFiles/refresh)
line 127 of main.php

require_once(/var/www/nesso/sapphire/main.php)
line 63 of index.php

</ul>

Please anyone help me.