I came across 500 server error after changing the site name manually (using mv command).
The server is accessible through browser and even all ajax calls are working except “/api/method/run_doc_method”.
It’s only happening while saving “Customize Form” and “DocType” forms.
NOTES:
After changing site-name I did run following commands:
- bench setup nginx
- update the domains in site_config.conf files
- brew services restart nginx
- bench --site [new-site] migrate
- bench start
Console traceback:
Object { url: "/api/method/run_doc_method", data: {…}, type: "POST", dataType: "json", async: undefined, headers: {…}, cache: false }
async: undefined
cache: false
data: Object { docs: "{\"name\":\"Customize Form\",\"max_attachments\":0,\"allow_copy\":0,\"istable\":0,\"editable_grid\":0,\"quick_entry\":0,\"track_changes\":1,\"track_views\":0,\"allow_auto_repeat\":0,\"allow_import\":1,\"show_preview_popup\":0,\"email_append_to\":0,\"sort_order\":\"ASC\",\"doctype\":\"Customize Form\",\"fields\":[{\"name\":\"Sales Partner-partner_information\",\"parent\":\"Customize Form\",\"parentfield\":\"fields\",\"parenttype\":\"Customize Form\",\"idx\":1,\"docstatus\":0,\"label\":\"Partner Information\",\"fieldtype\":\"Section Break\",\"fieldname\":\"partner_information\",\"non_negative\":0,\"reqd\":0,\"unique\":0,\"in_list_view\":0,\"in_standard_filter\":0,\"in_global_search\":0,\"in_preview\":0,\"bold\":0,\"allow_in_quick_entry\":0,\"translatable\":0,\"precision\":\"\",\"length\":0,\"fetch_if_empty\":0,\"permlevel\":0,\"hidden\":0,\"read_only\":0,\"collapsible\":0,\"allow_bulk_edit\":0,\"ignore_user_permissions\":0,\"allow_on_submit\":0,\"report_hide\":0,\"remember_last_selected_value\":0,\"hide_border\":0,\"in_filter\":0,\"hide_seconds\":0,\"hide_days\":0,\"print_hide\":0,\"print_hide_if_no_value\":0,\"…", method: "save_customization" }
dataType: "json"
headers: Object { "X-Frappe-CSRF-Token": "fb6a2b27a2ecdafacc8b0465112ca18b663f8e51985c8a0feab3f507", Accept: "application/json", "X-Frappe-CMD": "" }
type: "POST"
url: "/api/method/run_doc_method"
<prototype>: Object { … }
request.js:247:9
XHRPOSThttps://portal.nav.com/api/method/run_doc_method
[HTTP/1.1 500 Internal Server Error 51ms]
Object { readyState: 4, getResponseHeader: getResponseHeader(a), getAllResponseHeaders: getAllResponseHeaders(), setRequestHeader: setRequestHeader(a, b), overrideMimeType: overrideMimeType(a), statusCode: statusCode(a), abort: abort(a), state: state(), always: always(), then: then()
, … }
abort: function abort(a)
always: function always()
complete: function add()
done: function add()
error: function add()
fail: function add()
getAllResponseHeaders: function getAllResponseHeaders()
getResponseHeader: function getResponseHeader(a)
overrideMimeType: function overrideMimeType(a)
pipe: function then()
progress: function add()
promise: function promise(a)
readyState: 4
responseText: "<html>\r\n<head><title>500 Internal Server Error</title></head>\r\n<body>\r\n<center><h1>500 Internal Server Error</h1></center>\r\n<hr><center>nginx/1.21.0</center>\r\n</body>\r\n</html>\r\n"
setRequestHeader: function setRequestHeader(a, b)
state: function state()
status: 500
statusCode: function statusCode(a)
statusText: "Internal Server Error"
success: function add()
then: function then()
<prototype>: Object { … }
request.js:275:11
Unable to handle failed response request.js:315:12
console.trace() SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
call request.js:296
jQuery 6
call request.js:248
call request.js:98
call form.js:1439
set_primary_action customize_form__js:286
set_action page.js:254
jQuery 2
request.js:316:12
call request.js:316
jQuery 6
call request.js:248
call request.js:98
call form.js:1439
set_primary_action customize_form__js:286
set_action page.js:254
jQuery 2