Deploying a Go app with Imagemagick on Heroku - heroku

I've been trying to deploy a simple Go app with imagick
This requires Imagemagick. I've tried using the multi buildpack to install Imagemagick and run my app. This is how my .buildpack looks like:
https://github.com/mcollina/heroku-buildpack-imagemagick
https://github.com/kr/heroku-buildpack-go.git
And this is the error I see on Heroku:
Fetching repository, done.
Counting objects: 170, done.
Compressing objects: 100% (154/154), done.
Writing objects: 100% (169/169), 170.13 KiB | 0 bytes/s, done.
Total 169 (delta 21), reused 0 (delta 0)
-----> Fetching custom git buildpack... done
-----> Multipack app detected
=====> Downloading Buildpack: https://github.com/mcollina/heroku-buildpack-imagemagick
=====> Detected Framework:
-----> Installing libpng 1.5.14
Download completed
Installation completed
-----> Installing imagemagick 6.8.2-3
Download completed
Installation completed
-----> Building runtime environment for imagemagick
=====> Downloading Buildpack: https://github.com/kr/heroku-buildpack-go.git
=====> Detected Framework: Go
-----> Installing go1.3... done
-----> Running: godep go install -tags heroku ./...
# github.com/gographics/imagick/imagick
error: 'RemoveAlphaChannel' undeclared (first use in this function)
error: 'FlattenAlphaChannel' undeclared (first use in this function)
godep: go exit status 2
! Push rejected, failed to compile Multipack app
To git#heroku.com:philosoraptor-me.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to

I ended up using the image package from Go's excellent standard lib instead of depending on imagemagick.
This also taught me a valuable lesson about looking for a solution as close to the problem as possible than trying to solve it with a tool that I'm most familiar with.

Have you tried updating your local copy of gographics/imagick and doing godep update gographics/imagick ? The error error: 'FlattenAlphaChannel' undeclared seems to be coming from the library and not the buildpack

Related

whenever i try to push in Heroku,i get this error ."Cargo, the Rust package manager, is not installed or is not on PATH." how to resolve?

Preparing metadata (pyproject.toml): started
remote: Preparing metadata (pyproject.toml): finished with status 'error'
remote: error: subprocess-exited-with-error
remote:
remote: × Preparing metadata (pyproject.toml) did not run successfully.
remote: │ exit code: 1
remote: ╰─> [6 lines of output]
remote: Checking for Rust toolchain...
remote:
remote: Cargo, the Rust package manager, is not installed or is not on PATH.
remote: This package requires Rust and Cargo to compile extensions. Install it through
remote: the system's package manager or via https://rustup.rs/
remote:
remote: [end of output]
remote:
remote: note: This error originates from a subprocess, and is likely not a problem with pip.
remote: error: metadata-generation-failed
remote:
remote: × Encountered error while generating package metadata.
remote: ╰─> See above for output.
remote:
remote: note: This is an issue with the package mentioned above, not pip.
remote: hint: See above for details.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
You're going to need to use multiple buildpacks, one for Rust and another for Python.
Rust is not officially supported, but several community options exist. Pick one, then configure your application:
Set your application to use the Python buildpack:
heroku buildpacks:set heroku/python
Add your chosen Rust buildpack:
heroku buildpacks:add --index 1 YOUR_CHOSEN_BUILDPACK
Run heroku buildpacks to ensure they are correct. You should see the Rust buildpack first, and the Python buildpack second.
Finally, redeploy your application.

How to solve push error on uploading heroku?

I had made a bot on python using python-telegram-bot, but I am getting an error on pushing this code on Heroku on the command line.
my whole code is on python-telegram-bot but it gives me an error on uploading this from requirements.txt
I had cut some libraries which are uploaded without any error.
My error:-
PS D:\Code\python projects\Buddy_telegram_bot> git push heroku master
Enumerating objects: 29, done.
Counting objects: 100% (29/29), done.
Delta compression using up to 8 threads
Compressing objects: 100% (26/26), done.
Writing objects: 100% (29/29), 58.49 KiB | 5.85 MiB/s, done.
Total 29 (delta 10), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/python
remote: -----> Python app detected
remote: -----> Using Python version specified in runtime.txt
remote: ! Python has released a security update! Please consider upgrading to python-3.9.6
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.9.5
remote: -----> Installing pip 20.2.4, setuptools 47.1.1 and wheel 0.36.2
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote: Collecting aiohttp==3.7.4.post0
remote: Downloading aiohttp-3.7.4.post0-cp39-cp39-manylinux2014_x86_64.whl (1.4 MB)
remote: Collecting pypiwin32==223
remote: Downloading pypiwin32-223-py3-none-any.whl (1.7 kB)
remote: Collecting python-dotenv==0.18.0
remote: Downloading python_dotenv-0.18.0-py2.py3-none-any.whl (18 kB)
remote: Collecting python-telegram-bot==13.7
remote: Downloading python_telegram_bot-13.7-py3-none-any.whl (455 kB)
remote: ERROR: Could not find a version that satisfies the requirement pywin32==301 (from -r /tmp/build_f1a97cf9/requirements.txt (line 32)) (from versions: none)
remote: ERROR: No matching distribution found for pywin32==301 (from -r /tmp/build_f1a97cf9/requirements.txt (line 32))
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to buddy-telegram-bot.
remote:
To https://git.heroku.com/buddy-telegram-bot.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/buddy-telegram-bot.git'
Here I am getting an error on python-telegram-bot but I need it in my program
Please help me to solve this.

not able to push the repo to Heroku

I'm getting
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
when I try to push to Heroku , this is not a first push I have this app deployed in Heroku already, but all of a sudden Heroku started throwing this error.
I have tried
setting git config --global http.postBuffer 524288000
restarting all dynos
deleting Heroku project and creating it again.
tried pushing same repo to GitHub and it works fine.
I'm using macos-catalina
here is the complete error
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 12.x...
remote: Downloading and installing node 12.18.3
remote: Using default npm version: 6.14.6
remote:
remote: -----> Restoring cache
remote: - node_modules
remote:
remote: -----> Installing dependencies
remote: Installing node modules
error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 54
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly
any help would be appreciated. thanks
In case any one is facing similar issues , check Heroku logs , in my case next.js build was taking too much memory so the deploy was getting rejected, eventhough push was success.

Building meteor on dokku

There is a dropplet(vps) on digitalocean, the dropplet is built using dokku template. Following a bunch of instruction, I was able to set everything up. At least I think so. The problem appears during the build after git push. The log is here:
$ git push dokku master
Counting objects: 64, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (57/57), done.
Writing objects: 100% (64/64), 14.68 KiB | 0 bytes/s, done.
Total 64 (delta 4), reused 0 (delta 0)
remote: -----> Cleaning up...
remote: -----> Building ** from herokuish...
remote: -----> Adding BUILD_ENV to build environment...
remote: -----> Fetching custom buildpack
remote: -----> Node.js app detected
remote: -----> Installing node
remote: -----> Installing meteor
remote: Downloading Meteor distribution
remote:
remote: #
...
remote: ########################################################################
100.0%
remote:
remote: Meteor 1.2.1 has been installed in your home directory (~/.meteor).
remote:
remote: Now you need to do one of the following:
remote:
remote: (1) Add "$HOME/.meteor" to your path, or
remote: (2) Run this command as root:
remote: cp "/tmp/buildpacks/custom/meteor-o6l8/.meteor/packages/meteor-tool/1.1.10/mt-os.linux.x86_64/scripts/admin/launch-meteor" /usr/bin/meteor
remote:
remote: Then to get started, take a look at 'meteor --help' or see the docs at
remote: docs.meteor.com.
remote: -----> Bundling bundle
remote: -----> Building Meteor with ROOT_URL: http://****
remote: Killed
To dokku#****:**
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'dokku#****:**'
I am new to the theme. Where can I see what's gone wrong?
You might have too few resources to build meteor on your server. Please be sure you have at least 1GB of memory available. If you are on a smaller digital ocean droplet, you can also enable swap.

how to push ejabberd to heroku

I have cloned it into dir ejabberd. Ran the following commands.
./autogen.sh
./configure
make rel
made a Procfile
web: ./rel/ejabberd/bin/ejabberdctl start
with the following line it.
heroku create -buildpack https :// github .com/archaelus/heroku-buildpack-erlang.git
then did
git push heroku master
its gives me the following error
root#Anubhav:/home/anubhav/new/ejabberd# git push heroku master
Counting objects: 25255, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5322/5322), done.
Writing objects: 100% (25255/25255), 13.78 MiB | 167.00 KiB/s, done.
Total 25255 (delta 19874), reused 25251 (delta 19872)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote:
remote: ! Push rejected, no Cedar-supported app detected
remote: HINT: This occurs when Heroku cannot detect the buildpack
remote: to use for this application automatically.
remote: See https: // devcenter.heroku.com/articles/buildpacks
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to infinite-retreat-6912.
remote:
To https: //git.heroku.com/infinite-retreat-6912.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https: //git.heroku.com/infinite-retreat-6912.git'
What am I doing wrong?
I do not think ejabberd can be used as is on Heroku. There is several dependancies in C and lib required that are probably not available on Heroku. At least it has never been tested but I would be surprised if it worked.

Resources