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

Appending storage bucket ID to beginning of URL when fetching favicon #11436

Closed
devinowen opened this issue Dec 5, 2019 · 5 comments
Closed
Labels
bug [triage] something behaving unexpectedly help wanted [triage] Ideal issues for contributors to help with stale [triage] Issues that were closed to to lack of traction

Comments

@devinowen
Copy link

Issue Summary

Loading a favicon.png file from custom storage adapter on article pages throws a 500. It looks like the location URL has the original bucket ID string appended to the beginning, so that it's trying to get the icon from a URL like this:

BUCKET_ID/https://BUCKET_ID.storage.googleapis.com/2019/11/logo.png

Instead of what it should be:

https://BUCKET_ID.storage.googleapis.com/2019/11/logo.png

@mikenikles looked into it on the adapter side, and found that the URL was being stored correctly in the DB. However, somewhere in the retrieval process (perhaps in getLocalFileStoragePath()?) the bucket ID is incorrectly appended.
👇
mootoday/ghost-v3-google-cloud-storage#1 (comment)

To note, retrieval of all other assets work correctly using the custom adapter's read() method.

To Reproduce

  1. Create a new Ghost blog and add the https://github.com/mikenikles/ghost-v3-google-cloud-storage/blob/master/src/index.js adapter.
  2. Upload a favicon image. Upload works fine, but retrieval throws a 500. This doesn't occur for other assets.

Technical details:

  • Ghost Version: 3.1.1
  • Node Version: >10.0.0
  • Browser/OS: Chrome/MacOS
  • Database: Google Cloud Platform MySQL

Thanks all!

@allouis allouis added bug [triage] something behaving unexpectedly help wanted [triage] Ideal issues for contributors to help with storage-adapter labels Dec 6, 2019
@johngoggs
Copy link

+1

I also have this issue, and I've had it since 2.3x.x. I thought it was to do with an old GCS Storage Adapter, so I never reported it. The only difference I have to @devinowen, I have a CDN set up, so I have the CDN variable set.

When I was using GCS on 2.3x.x, with the adapter from KaySchneider, I had the CDN (assetDomain) variable set. I was also running Ghost in App Engine at this time, a different platform to what I am running now.

I have used a fresh 3.1.1 install, in Cloud run and against a clean Cloud SQL database, and I still get the same issue. I've tried the new install on Node 10.13 and 12.13.1.

Symptom: Ghost can take up to 30 seconds to load because of this.

Technical details:

Ghost Version: 3.1.1
Node Version: >10.0.0
Browser/OS: Chrome 78/ Windows 10 1903
Database: Google Cloud Platform MySQL

@stale
Copy link

stale bot commented Mar 11, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale [triage] Issues that were closed to to lack of traction label Mar 11, 2020
@devinowen
Copy link
Author

Any thoughts on if this is addressable in the Ghost codebase itself, or is in in the adapter? Seems like the issue may be in getLocalFileStoragePath()?

@stale stale bot removed the stale [triage] Issues that were closed to to lack of traction label Mar 11, 2020
@stale
Copy link

stale bot commented Jun 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale [triage] Issues that were closed to to lack of traction label Jun 9, 2020
@stale stale bot closed this as completed Jun 16, 2020
@safaci2000
Copy link

Is it possible to re-open this ticket? Or would you like me to open a new one? I'm running into the same issue with ghost 3.41 and danmasta/ghost-gcs-adapter@0.0.3. I'm running it in docker if it matters.

InternalServerError: Ghost GCS Adapter Error: No such object: gb-www-geekbeacon/https:/storage.googleapis.com/gb-www-geekbeacon/2021/03/0090a2b1dfbfdaf5.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [triage] something behaving unexpectedly help wanted [triage] Ideal issues for contributors to help with stale [triage] Issues that were closed to to lack of traction
Projects
None yet
Development

No branches or pull requests

4 participants