You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the "SQL Query" feature is active in Orchard Core 1.8.2, creating and attempting to run a long SQL query through "Search" > "Queries" > "All queries" results in an error when using the Run button:
HTTP Error 404.15 - Not Found. The request filtering module is configured to deny a request where the query string is too long
Instead, if a shorter query is first opened and then replaced by pasting the long query into the editor, it runs successfully.
As discussed in this conversation, the problem seems to be related on how the query is sent to the server. It is likely more appropriate to send the query as a POST request with the query in the body, rather than as a GET request with the query in the URL.
To Reproduce
Steps to reproduce the behavior:
Run the project using Visual Studio with a PostgreSQL database;
Enable the "SQL Query" feature;
Navigate to "Search" > "Queries" and create a short SQL query;
Create and save a longer SQL query;
Attempt to run the long query from the Run button under "Search" > "Queries" > "All queries";
Observe the error 404.15;
Go back and copy the long query;
Open and edit the short query;
Paste the long query into the editor and run it by clicking the Query button;
The long query executes without error.
Long query example:
I used a CAST() function named cast_text_to_jsonb because PostgreSQL does not support the default CAST(), as discussed here.
This query retrieves additional data from User using a CustomUserSettings content type, as detailed in the documentation. The data is stored in the Document DB table.
You can reproduce this issue with any long query. This is the one I used:
SELECT
UI."DocumentId",
UI."UserId",
UI."NormalizedUserName",
UI."NormalizedEmail",
STRING_AGG(UBRNI.RoleName, ',') AS RoleNames,
STRING_AGG(casttotext(UBRNID.UserByRoleNameIndexId), ',') AS RoleIds,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'Name', 'Text') AS FirstName,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'Surname', 'Text') AS LastName,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'Phone', 'Text') AS Phone,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'WhatsApp', 'Text') AS WhatsApp,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'Street', 'Text') AS Street,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'StreetNumber', 'Text') AS StreetNumber,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'City', 'Text') AS City,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'ParamOne', 'Text') AS ParamOne,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'ParamTwo', 'Url') AS ParamTwo,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'ParamThree', 'Url') AS ParamThree,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'ParamFour', 'Url') AS ParamFour,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'Description', 'Text') AS Description,
jsonb_extract_path_text(cast_text_to_jsonb(D."Content"), 'Properties', 'UserDetails', 'UserDetails', 'Logo', 'Paths') AS LogoPaths
FROM"UserIndex" UI
JOIN"Document" D ON UI."DocumentId"= D."Id"JOIN"UserByRoleNameIndex_Document" UBRNID ON UI."DocumentId"= UBRNID."DocumentId"JOIN"UserByRoleNameIndex" UBRNI ON UBRNID."UserByRoleNameIndexId"= UBRNI."Id"GROUP BY
UI."DocumentId",
UI."UserId",
UI."NormalizedUserName",
UI."NormalizedEmail",
D."Content"
Expected behavior
Click on Run should not return a 404.15 error. As demonstrated when editing an existing query or via the page "Search" > "Query" > "Run SQL Query".
Screenshots
This is the request URL that you can see in the screenshot:
While you can configure IIS and Kestrel to accept long URLs, yes, a better solution (and otherwise a more appropriate use of HTTP verbs) would be to send a POST request.
Is this something you'd perhaps be interested in contributing?
Describe the bug
When the "SQL Query" feature is active in Orchard Core 1.8.2, creating and attempting to run a long SQL query through "Search" > "Queries" > "All queries" results in an error when using the
Run
button:Instead, if a shorter query is first opened and then replaced by pasting the long query into the editor, it runs successfully.
As discussed in this conversation, the problem seems to be related on how the query is sent to the server. It is likely more appropriate to send the query as a
POST
request with the query in the body, rather than as aGET
request with the query in the URL.To Reproduce
Steps to reproduce the behavior:
Run
button under "Search" > "Queries" > "All queries";Query
button;Long query example:
I used a
CAST()
function namedcast_text_to_jsonb
because PostgreSQL does not support the defaultCAST()
, as discussed here.This query retrieves additional data from
User
using aCustomUserSettings
content type, as detailed in the documentation. The data is stored in theDocument
DB table.You can reproduce this issue with any long query. This is the one I used:
Expected behavior
Click on
Run
should not return a 404.15 error. As demonstrated when editing an existing query or via the page "Search" > "Query" > "Run SQL Query".Screenshots
This is the request URL that you can see in the screenshot:
The text was updated successfully, but these errors were encountered: