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

GdsApi::InvalidUrl exception when migrating assets #384

Closed
chrislo opened this issue Jan 8, 2018 · 10 comments
Closed

GdsApi::InvalidUrl exception when migrating assets #384

chrislo opened this issue Jan 8, 2018 · 10 comments
Assignees
Labels

Comments

@chrislo
Copy link
Contributor

chrislo commented Jan 8, 2018

https://sentry.io/govuk/app-whitehall/issues/429050852/

While running the task to migrate all assets under system/uploads/feature/image (Whitehall Feature images) (#215) some GdsApi::InvalidUrl exceptions were raised with messages such as

URI must be ascii only "https://asset-manager.publishing.service.gov.uk/whitehall_assets//government/uploads/system/uploads/feature/image/58661/s960_MOU_\u53F0\u82F1\u5408\u4F5C\u5099\u5FD8\u9304\u7C3D\u7F72-960x640.jpg"

It appears that some of the file names under that directory are non-ascii.

There are 42 jobs that are failing which equates to 6 individual assets in 7 different generated versions. An example of a publicly-available asset with a non-ascii URL.

The full list of files is:

  • system/uploads/feature/image/56493/Diseño_sin_título.jpg
  • system/uploads/feature/image/56493/s300_Diseño_sin_título.jpg
  • system/uploads/feature/image/56493/s630_Diseño_sin_título.jpg
  • system/uploads/feature/image/56493/s960_Diseño_sin_título.jpg
  • system/uploads/feature/image/56493/s216_Diseño_sin_título.jpg
  • system/uploads/feature/image/56493/s465_Diseño_sin_título.jpg
  • system/uploads/feature/image/56493/s712_Diseño_sin_título.jpg
  • system/uploads/feature/image/57540/Ambasáda_web.jpg
  • system/uploads/feature/image/57540/s300_Ambasáda_web.jpg
  • system/uploads/feature/image/57540/s630_Ambasáda_web.jpg
  • system/uploads/feature/image/57540/s960_Ambasáda_web.jpg
  • system/uploads/feature/image/57540/s216_Ambasáda_web.jpg
  • system/uploads/feature/image/57540/s465_Ambasáda_web.jpg
  • system/uploads/feature/image/57540/s712_Ambasáda_web.jpg
  • system/uploads/feature/image/57541/Ambasáda_web.jpg
  • system/uploads/feature/image/57541/s300_Ambasáda_web.jpg
  • system/uploads/feature/image/57541/s630_Ambasáda_web.jpg
  • system/uploads/feature/image/57541/s960_Ambasáda_web.jpg
  • system/uploads/feature/image/57541/s216_Ambasáda_web.jpg
  • system/uploads/feature/image/57541/s465_Ambasáda_web.jpg
  • system/uploads/feature/image/57541/s712_Ambasáda_web.jpg
  • system/uploads/feature/image/58283/rsz_may_and_löfven.jpg
  • system/uploads/feature/image/58283/s300_rsz_may_and_löfven.jpg
  • system/uploads/feature/image/58283/s630_rsz_may_and_löfven.jpg
  • system/uploads/feature/image/58283/s960_rsz_may_and_löfven.jpg
  • system/uploads/feature/image/58283/s216_rsz_may_and_löfven.jpg
  • system/uploads/feature/image/58283/s465_rsz_may_and_löfven.jpg
  • system/uploads/feature/image/58283/s712_rsz_may_and_löfven.jpg
  • system/uploads/feature/image/58657/MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58657/s630_MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58657/s216_MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58657/s712_MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58657/s300_MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58657/s960_MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58657/s465_MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58661/MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58661/s630_MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58661/s216_MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58661/s712_MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58661/s300_MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58661/s960_MOU_台英合作備忘錄簽署-960x640.jpg
  • system/uploads/feature/image/58661/s465_MOU_台英合作備忘錄簽署-960x640.jpg
@floehopper
Copy link
Contributor

@chrislo That sounds related to #371.

@chrisroos
Copy link
Contributor

@chrislo and I have just chatted about this and agreed that we should fix this problem so that we can upload these existing assets to Asset Manager. I'm planning to investigate this in the next couple of days.

@chrisroos
Copy link
Contributor

I've added this to the "Serve Whitehall non-attachment assets from Asset Manager" milestone as I think we'll need to fix the problem before we can close that milestone.

@chrisroos chrisroos added the bug label Jan 11, 2018
@chrisroos
Copy link
Contributor

I've opened alphagov/gds-api-adapters#794 to address this problem.

@chrisroos
Copy link
Contributor

We'll need to bump the version of gds-api-adapters and then use that new version in Whitehall before we can consider this issue to be fixed.

@chrisroos
Copy link
Contributor

I've opened alphagov/gds-api-adapters#795 to bump the version of the gds-api-adapters Gem.

chrisroos added a commit to alphagov/whitehall that referenced this issue Jan 11, 2018
So that I can get the change in
alphagov/gds-api-adapters#794 which should allow
me to fix alphagov/asset-manager#384.
@chrisroos
Copy link
Contributor

I've opened alphagov/whitehall#3677 to use the latest version of gds-api-adapters in Whitehall.

@chrisroos
Copy link
Contributor

Whitehall was upgraded to gds-api-adapters 50.9.1 in alphagov/whitehall#3678.

@chrisroos
Copy link
Contributor

Whitehall was deployed to staging and production this morning.

@chrisroos
Copy link
Contributor

I've marked the associated issue in Sentry as resolved and am closing this issue given that we hope this is fixed.

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

Successfully merging a pull request may close this issue.

3 participants