Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Row headings missing after update to Laravel 11 #4182

Open
1 task done
aceraven777 opened this issue Aug 12, 2024 · 9 comments
Open
1 task done

[Bug]: Row headings missing after update to Laravel 11 #4182

aceraven777 opened this issue Aug 12, 2024 · 9 comments

Comments

@aceraven777
Copy link

Is the bug applicable and reproducable to the latest version of the package and hasn't it been reported before?

  • Yes, it's still reproducable

What version of Laravel Excel are you using?

3.1.55

What version of Laravel are you using?

11.20.0

What version of PHP are you using?

8.3.9

Describe your issue

I'm exporting a CSV file on queue. And after updating to Laravel 11 the export seems to break the exporting of headings. The headings are missing.

The weird thing is this is working on my local environment, in my local environment I'm using Laravel sail (I'm using minio):

QUEUE_CONNECTION=redis

My live environment is in Vapor (i'm using AWS S3):

QUEUE_CONNECTION=sqs

How can the issue be reproduced?

Download fresh install of Laravel 11, and use queue export and there's no headings

What should be the expected behaviour?

There should be headings on the csv file

@aceraven777
Copy link
Author

@bpudenz commented related on this issue.

Comment on issue #1921

@bpudenz
Copy link

bpudenz commented Aug 16, 2024

I tried to dig in this afternoon and manually tweak it similar to the previous patch in the Sheet::open method with no luck.

Locally it works fine. Whats odd is my QA has exports that worked 10 days ago. I squashed a couple commits, so I'm not certain if a version changed in there, or if its a config value causing it or what. Not sure its helpful, but these are the only non-default config changes for working in a multi-server/queue environment:

'local_path' => sys_get_temp_dir(),
'local_permissions' => [
    'dir' => 0755,
    'file' => 0644,
],
'remote_disk' => 's3',
'remote_prefix' => null,
'force_resync_remote' => true,
        
class ClassName extends ExcelExport
    public function setUp()
    {
        $this->fromTable();
        $this->queue();
        $this->withWriterType(Excel::CSV);
        $this->withChunkSize(500);
    }
        

@aceraven777
Copy link
Author

I think the problem is somewhere here: 3.1.50...3.1.51

When I use 3.1.50 its working, but on 3.1.51 its not working.

@patrickbrouwers
Copy link
Member

I never use the multiserver setup, so I can't help here. If anyone figures out how perhaps #4034 causes this, feel free to PR a fix.

@aceraven777
Copy link
Author

I think I manage to pinpont where the problem is. The problem is in the file src/Writer.php, around line 169,

if ($temporaryFile instanceof RemoteTemporaryFile && !$temporaryFile->existsLocally()) {
    $temporaryFile = resolve(TemporaryFileFactory::class)
        ->makeLocal(Arr::last(explode('/', $temporaryFile->getLocalPath())));
}

If I commented that code it works on our vapor setup.

@FelipeSobral
Copy link

I'm having the same issue but I'm using Laravel 10 running on Bref

@patrickbrouwers
Copy link
Member

Can you please test #4198
If anything else to detect serverless is needed for Bref, please leave a comment on the PR

@aceraven777
Copy link
Author

I've tested it on Vapor, it seems this fixes our issue.

@FelipeSobral
Copy link

I am not sure if it is related... but I tested #4198 on Laravel 10 (bref) with multiserver setup... and now the export is not working at all

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants