Giter Club home page Giter Club logo

Comments (11)

xfumihiro avatar xfumihiro commented on July 25, 2024 14

In my case there's something wrong with Imagemagick which cause the conversion step to fail.

Error traced on this line
{:error, ["convert: unable to load module '/usr/local/Cellar/imagemagick/7.0.5-10/lib/ImageMagick//modules-Q16HDRI/coders/jpeg.la': file not found @ error/module.c/OpenModule/1266.\nconvert: no decode delegate for this image format JPEG' @ error/constitute.c/ReadImage/509.\nconvert: no images defined /var/folders/s3/j8_f62kx4dx8g7j_q5rb3my80000gn/T/EMXOWSUFDBT73REVERBBWH7RQ7KASJQU' @ error/convert.c/ConvertImageCommand/3254.\n", "convert: unable to load module '/usr/local/Cellar/imagemagick/7.0.5-10/lib/ImageMagick//modules-Q16HDRI/coders/jpeg.la': file not found @ error/module.c/OpenModule/1266.\nconvert: no decode delegate for this image format JPEG' @ error/constitute.c/ReadImage/509.\nconvert: no images defined /var/folders/s3/j8_f62kx4dx8g7j_q5rb3my80000gn/T/33GWBMEKZ4WICVJRMGYKZ3W3DYA3YXET' @ error/convert.c/ConvertImageCommand/3254.\n"]}

Everything back to normal after "brew update imagemagick".

from arc_ecto.

shawnonthenet avatar shawnonthenet commented on July 25, 2024 2

So I had this problem tonight and it ended up being that I had the wrong settings in prod for my IAM token so the upload to s3 was failing.

from arc_ecto.

denispeplin avatar denispeplin commented on July 25, 2024 2

As it said above, upload failure to S3 causes is invalid error. It is also included in tests:

test_with_mock "cascades storage error into an error", DummyDefinition, [store: fn({%{__struct__: Plug.Upload, path: "/path/to/my/file.png", file_name: "file.png"}, %TestUser{}}) -> {:error, :invalid_file} end] do

So any kind of storage failure will cause is invalid error.
Why not raise or propagate adequate error? Image itself is fine, it's just some network error.

from arc_ecto.

martinthenth avatar martinthenth commented on July 25, 2024

Having the same issue: invalid or unknown type error is thrown by Ecto for MyUploader.Type.

** (ArgumentError) invalid or unknown type MyApp.ImageUploader.Type for field :image
    lib/ecto/schema.ex:1727: Ecto.Schema.check_type!/3
    lib/ecto/schema.ex:1431: Ecto.Schema.__field__/4
    lib/accounts/user/user.ex:15: (module)
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6

from arc_ecto.

jhonathas avatar jhonathas commented on July 25, 2024

Also here.

from arc_ecto.

nkezhaya avatar nkezhaya commented on July 25, 2024

Getting this as well. @shawnonthenet can you elaborate on your IAM issue? I only have a single user and key. Works on another dev's machine.

from arc_ecto.

nkezhaya avatar nkezhaya commented on July 25, 2024

@xfumihiro Thanks!! brew update imagemagick fixed it.

from arc_ecto.

aesmail avatar aesmail commented on July 25, 2024

This should have more visibility. Upgrading Imagemagick did the trick as @xfumihiro mentioned.

from arc_ecto.

max-bertinetti avatar max-bertinetti commented on July 25, 2024

(ArgumentError) invalid or unknown type Golfcoupons.PackageImageUploader.Type for field :image
lib/ecto/schema.ex:1886: Ecto.Schema.check_type!/3
lib/ecto/schema.ex:1507: Ecto.Schema.field/4
lib/golfcoupons/golf/package.ex:10: (module)
(stdlib) erl_eval.erl:670: :erl_eval.do_apply/6

I have ImageMagik installed on Linux Mint 18.2 (package version 8:6.8.9.9-7ubuntu5.9)

from arc_ecto.

devnacho avatar devnacho commented on July 25, 2024

I'm having this problem and I can't make it work.

I've uninstalled and reinstalled imagemagick with homebrew and I still get [image: {"is invalid",

Anyone else with this problem or any other possible solution?

from arc_ecto.

denispeplin avatar denispeplin commented on July 25, 2024

So I've lost about an hour trying to get a debug to find out why I received is invalid error. Image was fine (size and type), and my validator passed it. But after cast I received is invalid anyway.
Errors got swallowed up here: https://github.com/stavro/arc_ecto/blob/master/lib/arc_ecto/type.ex#L20
I put IO.inspect definition.store(args) in the cast function and got the error:

 [{:http_error, 403,
   %{body: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>RequestTimeTooSkewed</Code><Message>The difference between the request time and the current time is too large.</Message><RequestTime>20180810T132202Z</RequestTime><ServerTime>2018-08-10T13:37:30Z</ServerTime><MaxAllowedSkewMilliseconds>900000</MaxAllowedSkewMilliseconds><RequestId>B78B31447C732471</RequestId><HostId>...</HostId></Error>",
     headers: [{"x-amz-request-id", "..."},
      {"x-amz-id-2",
       "..."},
      {"Content-Type", "application/xml"}, {"Transfer-Encoding", "chunked"},
      {"Date", "Fri, 10 Aug 2018 13:37:29 GMT"}, {"Server", "AmazonS3"}],
     status_code: 403}}]}

So S3 response was very clear (server clocks went out of sync this time), but because arc_ecto swallowed up the error, it takes too much time to debug it.

Better to raise an error than to handle it that way.

from arc_ecto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.