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

Error when using getContents in Servd #31

Open
Mosnar opened this issue Sep 25, 2024 · 3 comments
Open

Error when using getContents in Servd #31

Mosnar opened this issue Sep 25, 2024 · 3 comments

Comments

@Mosnar
Copy link
Contributor

Mosnar commented Sep 25, 2024

          @kennethormandy I changed this because i kept getting an error for the `getContents()` function:
2024-09-24 16:37:24 [web.ERROR] [Error] Error: Call to a member function getAsset() on null in /var/www/html/vendor/venveo/craft-compress/src/controllers/CompressController.php:73

I wasn't sure if this was because we were using Servd and their remote storage and it was struggling to grab the image.

I suppose if you want to keep the way i've done it, you could just pass the path rather than the url if some filesystems don't have public URL's

Originally posted by @bymayo in #29 (comment)

@Mosnar Mosnar mentioned this issue Sep 25, 2024
@Mosnar
Copy link
Contributor Author

Mosnar commented Sep 25, 2024

@bymayo I reverted this change, switching back to $asset->getContents() and tested the following scenarios trying to reproduce the issue:

  1. Create archive using only S3 volumes
  2. Create archive using public Servd volume
  3. Create archive using private Servd volume

None of these scenarios caused any errors. Were you running the code on Servd when you got this error or were you running locally using a Servd volume?

For the moment, I've pushed a commit reverting back to the old getContents method, as I think it's a cleaner API for us to use. I haven't tagged a release yet because I'd like to get to the bottom of your error.

@bymayo
Copy link
Contributor

bymayo commented Sep 25, 2024

@Mosnar I was running it locally, hooking in to Servd on a DDEV environment.

I'll use this release and see if i can figure out the issue a bit better.

@Mosnar
Copy link
Contributor Author

Mosnar commented Sep 25, 2024

@Mosnar I was running it locally, hooking in to Servd on a DDEV environment.

I'll use this release and see if i can figure out the issue a bit better.

Thanks! One thing worth checking is that your Servd asset storage environments are in-sync. If you're using a copy of the production database but using staging assets, it's possible an asset is missing.

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

No branches or pull requests

2 participants