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
https://docs.bitnami.com/general/apps/wordpress/troubleshooting/debug-errors-apache/
https://docs.bitnami.com/aws/apps/wordpress/troubleshooting/debug-errors-mariadb/
https://docs.bitnami.com/installer/faq/linux-faq/administration/increase-memory-linux/

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

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

Please contact the server administrator at you@example.com 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:

https://docs.bitnami.com/aws/apps/erpnext/administration/backup-restore/

Regards,
Michiel

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 (bitnami.com)

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?

Regards,
Michiel

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/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/opt/bitnami/python/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 104, in <module>
    main()
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/utils/bench_helper.py", line 19, in main
    click.Group(commands=commands)(prog_name='bench')
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/click/core.py", 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/core.py", 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/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/commands/__init__.py", line 27, in _func
    ret = f(frappe._dict(ctx.obj), *args, **kwargs)
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/commands/site.py", line 306, in migrate
    migrate(
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/migrate.py", line 67, in migrate
    frappe.modules.patch_handler.run_all(skip_failing)
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 41, in run_all
    run_patch(patch)
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 30, in run_patch
    if not run_single(patchmodule = patch):
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 71, in run_single
    return execute_patch(patchmodule, method, methodargs)
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/modules/patch_handler.py", line 91, in execute_patch
    frappe.get_attr(patchmodule.split()[0] + ".execute")()
  File "/opt/bitnami/erpnext/frappe-bench/apps/erpnext/erpnext/patches/v13_0/check_is_income_tax_component.py", 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/database.py", line 664, in set_value
    self.sql("""update `tab{0}`
  File "/opt/bitnami/erpnext/frappe-bench/apps/frappe/frappe/database/database.py", line 147, in sql
    self._cursor.execute(query, values)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/cursors.py", line 148, in execute
    result = self._query(query)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/cursors.py", line 310, in _query
    conn.query(q)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", 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/connections.py", line 775, in _read_query_result
    result.read()
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "/opt/bitnami/erpnext/frappe-bench/env/lib/python3.8/site-packages/pymysql/err.py", 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:

https://discuss.erpnext.com/

Regards,
Michiel

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