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.
hillel
February 18, 2024, 1:07pm
2
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]
hillel
February 18, 2024, 1:15pm
4
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.
opened 01:44PM - 18 Feb 24 UTC
closed 09:38PM - 18 Feb 24 UTC
fixed
## Setup
- Version: v5.8.25-C155
- Environment: Docker Self-hosted
## Inter… face
- Flutter: []
## Checklist
- Can you replicate the issue on our v5 demo site [NO]
- Have you searched existing issues? [YES]
- Have you reported this to Slack/forum before posting? [YES]
[https://forum.invoiceninja.com/t/fault-with-export-to-json-function/15398](url)
- Have you inspected the logs in storage/logs/laravel.log for any errors? [YES]
## Describe the bug
500: Internal Server Error • Server Error
Error is thrown when attempting to perform Export to JSON Function [Settings-->Import|Export] via web interface
### Steps To Reproduce
Navigate to Settings--Import|Export--Change format from CSV to JSON--click on Export button
### Expected Behavior
popup message detailing that export is taking place and to wait a moment
## Additional context
Performed an upgrade from v5.7xx to latest release v5.8.25-C155
using the following commands:
docker-compose down
docker-compose pull
docker-compose up -d
### Screenshots
### Logs
Error message within web interface:
500: Internal Server Error • Server Error
laravel.log:
```
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]
```
Server log
```
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" "-"
```
1 Like
hillel
February 18, 2024, 10:46pm
7
Glad to hear it, thanks for the update!
1 Like