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] ** (UndefinedFunctionError) function :hackney.request/5 is undefined (module :hackney is not available) #71

Closed
Tracked by #70
nelsonic opened this issue Jun 14, 2023 · 4 comments
Assignees
Labels
BLOCKED :fire: Core team's HIGHEST priority, blocking critical work chore a tedious but necessary task often paying technical debt priority-1 Highest priority issue. This is costing us money every minute that passes. T2h Time Estimate 2 Hours tech-debt A feature/requirement implemented in a sub-optimal way & must be re-written technical A technical issue that requires understanding of the code, infrastructure or dependencies

Comments

@nelsonic
Copy link
Member

The REST API PR #61 was merged. ✅
But sadly when we attempt to upload an image via Hoppscotch we get the following error:
https://imgup.fly.dev/api/images

image

Logs: https://fly.io/apps/imgup/monitoring

imgup-hackney-request-fails
[error]  ** (UndefinedFunctionError) function :hackney.request/5 is undefined (module :hackney is not available)

[info] :hackney.request(:post, "https://s3.eu-west-3.amazonaws.com/imgup-original/zb2rhg1D3wGz3ps1wsUURdkSPLeFG5NTihkMtnpHHnXnFvSSo.png?uploads=1", 
[{"Authorization", "AWS4-HMAC-SHA256 
Credential=AKIAETC/20230614/eu-west-3/s3/aws4_request,SignedHeaders=content-length;host;x-amz-acl;x-amz-content-sha256;x-amz-date,Signature=65011ed0fc91075d3d429cda2ab70eda47ae4d3b214f187b34dbb0e8de8244a4"}, 
{"host", "s3.eu-west-3.amazonaws.com"}, {"x-amz-date", "20230614T102209Z"}, 
{"content-length", "0"}, {"x-amz-acl", "public-read"}, 
{"x-amz-content-sha256", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}], 
"", [:with_body, {:recv_timeout, 30000}])

Very curious why the {"content-length", "0"} is it not reading the file? 💭

@LuchoTurtle do you mind investigating this? 🙏
Feel free to:
a) revert back to your version of the API from before I made changes.
b) deploy directly to Fly to figure out why the uploads don't work.

@nelsonic nelsonic added priority-1 Highest priority issue. This is costing us money every minute that passes. chore a tedious but necessary task often paying technical debt technical A technical issue that requires understanding of the code, infrastructure or dependencies T2h Time Estimate 2 Hours tech-debt A feature/requirement implemented in a sub-optimal way & must be re-written BLOCKED :fire: Core team's HIGHEST priority, blocking critical work labels Jun 14, 2023
nelsonic added a commit that referenced this issue Jun 14, 2023
This was referenced Jun 14, 2023
@nelsonic
Copy link
Member Author

Added dbg(params) to the ApiController ...

image

Magically the upload works!!
image

{
  "compressed_url": "https://s3..amazonaws.com/imgup-compressed/zb2rhmR1QkHPjVgBSydcBCT7Pkq9hMSpWxqWoJMn9udtXJRXk.jpg",
  "url": "https://s3.eu-west-3.amazonaws.com/imgup-original/zb2rhmR1QkHPjVgBSydcBCT7Pkq9hMSpWxqWoJMn9udtXJRXk.jpg"
}

@nelsonic
Copy link
Member Author

@LuchoTurtle if you try to display one of these uploaded images e.g:

![img](https://s3.eu-west-3.amazonaws.com/imgup-original/zb2rhmR1QkHPjVgBSydcBCT7Pkq9hMSpWxqWoJMn9udtXJRXk.jpg)

you will see the "broken" image icon:

img

Need to understand why ... is it a mime/content type issue? ref #69

@LuchoTurtle
Copy link
Member

Since this is already working and #72 was already created for the issue of showing images on Github, can you close this issue?

@nelsonic
Copy link
Member Author

Yes, was just about to close this. Thanks. 👍
GOTO: #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLOCKED :fire: Core team's HIGHEST priority, blocking critical work chore a tedious but necessary task often paying technical debt priority-1 Highest priority issue. This is costing us money every minute that passes. T2h Time Estimate 2 Hours tech-debt A feature/requirement implemented in a sub-optimal way & must be re-written technical A technical issue that requires understanding of the code, infrastructure or dependencies
Projects
Status: Done
Development

No branches or pull requests

2 participants