Internal Server Error after restoring database of ERPNext

Keywords: ERPNext - AWS - Technical issue - Other

bnsupport ID: c00ed1f6-627e-dabb-afed-f22db39ab50e

bndiagnostic output:

? Apache: Found possible issues
? Mariadb: Found possible issues
? Resources: Found possible issues

bndiagnostic failure reason: Not been able to pinpoint on the problem and resolve it.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Hi @rajat1,

Did you follow the steps in this guide:


Hello MIchiel,

Yes, I’ve first backed up the database and public and private files from my frappe cloud of erpnext.
I then, deployed the erpnext software from bitnami using your cloud, and then I migrated using the backup and files above using your guide here:
Migrate an ERPNext installation (

When I first deployed the bitnami image I could log onto the ERPNext installation, but when I did the migration I had to carry out the steps multiple times :frowning: because I faced issues in the max_packet_size mariadb parameter value

Finally, The sql ran for quite some time and errored with the error below:
Table ‘tabDefaultValue’ missing in the restored site. Database not installed correctly, this can due to lack of permission, or that the database name exists. Check your mysql root password, validity of the backup file or use --force to reinstall

I looked at the table values using mysql and they seem to have restored correctly.
From here onwards, I keep getting the internal server error :frowning:
I don’t know whether this is related to the fact that I’ve migrated the installation from cloud to my own vm on aws ? or if the database error is related to some import problem.

Hi @rajat1,

Did you delete the existing database on the new instance before importing the old one? Also, was the imported database from another Bitnami installation, and was it the same version?


Yes. We did delete the existing database on the new instance before importing the old one.

The imported database was a backup from an Enterprise Installation that we were using on ERPNext, and not with Bitnami. The version of the installation was 12.0 and we tried to use the bench --site erpnext migrate too but after a series of successful execution there, we got the below:

Traceback (most recent call last):
  File "/opt/bitnami/python/lib/python3.8/", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/bitnami/python/lib/python3.8/", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/utils/", line 104, in <module>
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/utils/", line 19, in main
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/click/", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/click/", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/click/", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/click/", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/click/", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/click/", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/click/", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/commands/", line 27, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/commands/", line 306, in migrate
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/", line 67, in migrate
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/modules/", line 41, in run_all
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/modules/", line 30, in run_patch
    if not run_single(patchmodule = patch):
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/modules/", line 71, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/modules/", line 91, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/opt/bitnami/erpnext/frappe-bench/apps/erpnext/erpnext/patches/v13_0/", line 47, in execute
    frappe.db.set_value("Salary Component", "Provident Fund", "component_type", "Provident Fund")
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/database/", line 664, in set_value
    self.sql("""update `tab{0}`
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/database/", line 147, in sql
    self._cursor.execute(query, values)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/", line 148, in execute
    result = self._query(query)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/", line 310, in _query
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/", line 775, in _read_query_result
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/", line 725, in _read_packet
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/", line 221, in raise_for_error
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1054, "Unknown column 'component_type' in 'field list'")

Hi @rajat1,

I recommend asking in a dedicated ERPNext forum:


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.