Fault with Export to JSON function

Hi folks,

I have just performed an upgrade from V5.7xx to 5.8.25-C155 using docker.
Everything seems to be working fine, however, upon running the JSON Export Function (Settings–>Import|Export) an error is thrown ‘500: Internal Server Error • Server Error’

The corresponding log is as follows:

192.168.50.146 - - [18/Feb/2024:12:55:00 +0000] "POST /api/v1/export? HTTP/1.1" 500 44 "http://in.localhost.test:88/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"

Prior to upgrade export function was working and the system has been stable for 12+ months.

Is there any maintenance I need to perform after an upgrade? (commands to run to make sure integrity is solid. In the past i ran docker exec -it invoiceninja_db_1 mysql_upgrade -uroot -p when upgrading mysql v5 to v8. without this command system would not function).

Thank you.

Hi,

Are there any details about the 500 error in storage/logs?

Hi @hillel , sorry i ought to have included that in my OP.

The following is from the log file:

[2024-02-18 13:07:02] production.ERROR: Class "Hyvor\JsonExporter\File" not found {"userId":1,"exception":"[object] (Error(code: 0): Class \"Hyvor\\JsonExporter\\File\" not found at /var/www/app/app/Jobs/Company/CompanyExport.php:75)
[stacktrace]

It may help to run composer install, otherwise feel free to create an issue on GitHub for this.

‘Run composer install’, sorry I’m not to sure what that is?

Also, i consoled into ’ [invoiceninja_app_1]’

i copied a segment out of the php file that is referenced in the laravel.log

class CompanyExport implements ShouldQueue
{
    use Dispatchable;
    use InteractsWithQueue;
    use Queueable;
    use SerializesModels;
    use MakesHash;

    private $export_format = 'json';

    private $export_data = [];
    private $writer;
    private $file_name;
    /**
     * Create a new job instance.
     *
     * @param \App\Models\Company $company
     * @param \App\Models\User $user
     * @param string $hash
     */
    public function __construct(public Company $company, private User $user, public string $hash)
    {
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        MultiDB::setDb($this->company->db);


        $this->file_name = date('Y-m-d') . '_' . str_replace([" ", "/"], ["_",""], $this->company->present()->name() . '_' . $this->company->company_key . '.json');

        $this->writer = new File($this->file_name);

        set_time_limit(0);

If you think it best I will raise an issue over at github.

Thank you.

Warm regards,

FYI,

Issue fixed in release v5.8.26.

1 Like

Glad to hear it, thanks for the update!

1 Like