How to deploy openbazaar-go to heroku - go

How can I deploy openbazaar-go to heroku?
I got the go project go get github.com/OpenBazaar/openbazaar-go
Created heroku git heroku create
Push git changes git push heroku master
But getting error
remote: -----> Checking Godeps/Godeps.json file.
remote: parse error: Invalid numeric literal at line 2504, column 8
remote: !! Bad Godeps/Godeps.json file
remote: ! Push rejected, failed to compile Go app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to pacific-stream-51465.
Structure go
github.com
└──OpenBazaar
└── openbazaar-go
└──`heroku create` (this I created git project)
This project have any subrepository

What version of Golang are you using? OpenBazaar runs predominantly on 1.11 and isn't currently set up to work well on 1.13 and above.

Related

error when I push my project to heroku [remote rejected] [duplicate]

I tried to deploy my simple django project on heroku, but i couldn't understand how to solve this problem
This is the git push heroku master
remote: Traceback (most recent call last):
remote: File "/tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/vendor/runtime-fixer", line 8, in <module>
remote: r = f.read().strip()
remote: File "/usr/lib/python3.8/codecs.py", line 322, in decode
remote: (result, consumed) = self._buffer_decode(data, self.errors, final)
remote: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
remote: /tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/bin/steps/python: line 5: warning: command substitution: ignored null byte in input
remote: ) is not available for this stack (heroku-20).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 898dd95ff261fc77ac4dcd00edd162d7b7c054f2
remote: !
remote: ! We have detected that you have triggered a build from source code with version 898dd95ff261fc77ac4dcd00edd162d7b7c054f2
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to portfolio-project10.
remote:
To https://git.heroku.com/portfolio-project10.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/portfolio-project10.git'
C:...\portfolio-project>
It would be very nice if anyone could help me with this, or even recommending an other way to deploy django projects for free
That entire traceback is inside these parentheses: () is not available for this stack. That is the message shown when you request a Python runtime that isn't available. In this case, it looks like your runtime.txt can't even be read due to an unexpected encoding.
Delete it, then create a new file containing something like
python-3.10.2
only. Make sure it is UTF-8 encoded, commit, and redeploy.
At the moment, these are the currently supported Python versions, but the list changes as new versions are released:
python-3.10.2
python-3.9.10
python-3.8.12
python-3.7.12
I had the same issue when i was deploying my django application to Heroku. The issue is because of encoding error. Heroku is expecting the file to be saved with utf-8 but I realised that my file was saved with utf-16 le.
So if you are working in vscode then i would suggest to check the encoding for the runtime file at the bottom of vscode
If you click on utf-8 you will get the option of saving the file with different encoding .
Otherwise you can also save the file in notepad. Default encoding used by notepad is utf-8 only
That will work for sure.
Check for other files encoding also if this doesn't solve the problem
very simple
just delete the runtime.txt and push the code
this worked for me .
thankyou

ROOT_URL is not defined | Pushing is causing a build failure

If I go to the the build log I see the following:
-----> Node.js app detected
FATAL: ROOT_URL is not defined.
! Push rejected, failed to compile Node.js app.
! Push failed
This is what I am getting in my terminal:
remote: Building source:
remote:
remote: -----> Node.js app detected
remote: FATAL: ROOT_URL is not defined.
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to virtually-viral.
remote:
To https://git.heroku.com/virtually-viral.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/virtually-viral.git'
NOTE: I do not know what to do to fix this and get my app working, I have checked multiple discussions on people having a somewhat similar problem but I was not able to fix it with their solutions.
I don't know much about Meteor so I'm not sure why this works in development, nor can I find any canonical list of critical settings that are required for it to work. The closest I can find is the documentation for Meteor.absoluteUrl (bold added):
Generate an absolute URL pointing to the application. The server reads from the ROOT_URL environment variable to determine where it is running. This is taken care of automatically for apps deployed to Galaxy, but must be provided when using meteor build.
You should be able to get past this issue by setting the ROOT_URL variable on Heroku, e.g.
heroku config:set ROOT_URL=https://virtually-viral.herokuapp.com
or through the web interface.

Error on mgo dependency when deploying go app to Heroku

I'm trying to deploy a Go App to Heroku, I'm using godeps for dependency management as their docs suggested.
But when I git push heroku master I get the following error telling that the file sasl.go doesn't exists.
remote: # github.com/grsouza/feeng-api/vendor/gopkg.in/mgo.v2/internal/sasl
remote: vendor/gopkg.in/mgo.v2/internal/sasl/sasl.go:15:24: fatal error: sasl/sasl.h: No such file or directory
remote: // #include <sasl/sasl.h>
remote: ^
remote: compilation terminated.
remote: github.com/grsouza/feeng-api/vendor/github.com/onsi/gomega
remote:
remote: ! Push rejected, failed to compile Go app
remote:
remote: Verifying deploy....
remote:
remote: ! Push rejected to limitless-ridge-36512.
remote:
To https://git.heroku.com/limitless-ridge-36512.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/limitless-ridge-36512.git'
Can anyone help me with this issue?
Thanks.
Do you use godep save ./... in your project?
If yes, delete the Godep and vendor directories and try to use godep save, without ./....
I do this and work for me.
Error tells sasl/sasl.h missing but not sasl.go. sasl.h header file is part of libsasl2-dev package which not installed on heroku and I don't know simple way to install it. To my mind you can try to find sasl headers on your local machine(most likely /usr/include/sasl)and copy to vendor/include/sasl in your local go app source. Then make them visible for CGO using heroku config vars doing
heroku config:set CGO_CFLAGS= -I/app/code/vendor/include/sasl
in heroku console, and than git push.
Also you can look for libsasl2-dev buildpack for heroku and try to use two buildpacks for your app with something like
heroku buildpacks:add heroku/some_libsasl2-dev
I finally found a solution (from https://github.com/go-mgo/mgo/issues/220#issuecomment-212658192):
run godep save ./... (to create the vendor directory with all the dependencies)
then re-run godep save without ./... (this will remove unused files)

Heroku run binary version of web(golang)

I'm trying to use https://github.com/ryandotsmith/null-buildpack
and have compiled web process version(linux x64)
but when i'm doing git push heroku master process hangs on
remote: Compressing source files... done.
remote: Building source:
remote:
remote: Build stream timed out, reverting to polling...............
Procfile:
web: /app/bin/www
Was caused by a heroku issue, resolved now
https://status.heroku.com/

git, Heroku: pre-receive hook declined

I am in the process of setting up a git repository and attempting to link it to Heroku. When I run the command
git push heroku master
I receive
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (7/7), 714 bytes, done.
Total 7 (delta 1), reused 0 (delta 0)
-----> Heroku receiving push
! Heroku push rejected due to an unrecognized error.
! We've been notified, see http://support.heroku.com if the problem persists.
To git#heroku.com:morning-stream-3712.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:morning-stream-3712.git'
How can I get my application pushed to Heroku?
Make sure you are pushing a repo that contains a proper supported app ( Rails, Django etc.) and you are not just pushing some random repo to test it out.
Newbie in Heroku: Error when push my app to Heroku
If that is not the case and you are pushing what you think is a valid app, contact Heroku support and they will fix it for you.
Make sure that you are using either npm or yarn.lock file-
Two different lockfiles found: package-lock.json and yarn.lock
Both npm and yarn have created lockfiles for this application,
but only one can be used to install dependencies.
After deleting yarn.lock and pushing the code again to git, my issue resolved.
Deleting package-lock.json solved it for me
First, disable collectstatic:
heroku config:set DISABLE_COLLECTSTATIC=1
Then run:
git push heroku master
For more details and full steps, check here.
I faced the same problem:
! [remote rejected] vX.X.XX -> master (pre-receive hook declined)
error: failed to push some refs to 'git#heroku.com:[application-name]'
I realized that my heroku application Stack is 'cedar-10' and was deprecated from 04/11/2014 and disabled from 04/11/2015 (Cedar-14 is now Generally Available).
The solution was to upgrade the heroku application Stack following the guide:
Upgrading the production app to Cedar-14
Another issue could be that in a production environment, you can't use sqlite3, the default database when you make a rails app.
In order to fix this, just change the database your rails app uses to Postgres. This can easily be accomplished by editing your Gemfile
From your Gemfile, remove:
gem sqlite3;
and add the following:
group :development, :test do
gem 'sqlite3'
end
group :production do
gem 'pg'
end
I had the same problem but with a Django app, it turned out that pip wasn't able to download/install one of the dependencies of the requirements.txt file (it was eyeD3)
A little late to the game, one of my issues was I had an outdated sshkey. Just need to update that in the settings.
Another thing was I was pushing Python Django CMS, and it was running python manage.py collectstatic during deploy and it was failing. So make sure you check the log heroku logs --tail. That gave me another hint to turn off collectstatic, it event tells you what to type to turn it off.
Came across this same error when deploying a node app, but resolved with these two steps and thought I'd share in case anyone else runs into the same issues.
Make sure you aren't committing node_modules since heroku installs dependencies from package.json on push. Try adding node_modules/ to your .gitignore to ensure you don't accidentally commit it
Heroku uses Node v12 which node-sass 4.10.0 will fail to build with. Try increasing node-sass version by adding the following. This allowed it to build successfully for me:
"devDependencies": {
"node-sass": "^4.12.0"
}
In case if this needs anyone in future even though I am a beginner and doesn't know much about Heroku, you may have requested a version in runtime.txt file which the stack doesn't support.
python-3.8.2 to python-3.8.10
Changing from python-3.8.2 to python-3.8.10 helped me solved it. You may see the supported stacks here: https://devcenter.heroku.com/articles/python-support
I had this problem (same error with Heroku):
To https://git.heroku.com/myapp.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/myapp.git'
The mistake
I made some changes to my code and removed some parameters, apparently I missed a simple comma (,) on a line. This caused a build error. Which was not visible in the console upon pushing, only the "pre-receive hook declined" error.
SOLUTION
I fixed the comma issue, rebuild and pushed to Heroku and now it works.
If you have an error in your css this error can also show up.
In one of my media queries I put
#media screen adn (min-width: 1000px) {
Instead of the "and" which gave me this error.
A good indicator that this may be the case is if you get an error that contains the message
"Tasks: TOP => assets:precompile ... Precompiling assets failed"
That was my first clue to look in my css.
I decided to read the logs line by line.
Below is part of the error logs:
remote: > gbt-ltd-website-frontend#0.1.0 build /tmp/build_c37edf59
remote: > react-scripts build
remote:
remote: Creating an optimized production build...
remote: Failed to compile.
remote:
remote: Cannot read property 'toLowerCase' of undefined
remote: CompileError: Begins at CSS selector .Styles_hone__1Uuf2
remote:
remote:
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! gbt-ltd-website-frontend#0.1.0 build: `react-scripts build`
remote: npm ERR! Exit status 1
...
remote: ! Push rejected to gbtstructurals.
remote:
To https://git.heroku.com/gbtstructurals.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/gbtstructurals.git'
From where the error started, "npm ERR! code ELIFECYCLE" I read up and I found the actual cause of the error. It was a CSS rule. I first removed the rule and it built. Then I checked my declarations and found out I was contradicting myself.
i thought , this will not be the error occured due to any app , or code changes.
i have same problem now this happen due to the following reason:
1) i have code on bitbucket/git i push the code to repository (this
repo is linked with the heroku app,meanse changes to this will
reflects on heroku)
2)after pushing code to repo , i am trying to push code on heroku
with "git push heroku master" but due to some reason i abort this
command, thats why code is not pushed to heroku
3)then i am agian triyng to push code to heroku it says same error
as above
4) the solution for this is "just pull yours last commited code"
and push the changes to heroku ..thats it thanks
I had this with a sinatra application. (Heroku does support Sinatra).
The instructions on the heroku blog post were incomplete
https://blog.heroku.com/32_deploy_merb_sinatra_or_any_rack_app_to_heroku
My program ran fine locally but I got that error when trying to push to heroku.
The heroku blogpost didn't include the need to make a gemfile and do bundle install. The program was running locally fine, but to make it work on heroku it needed a Gemfile and bundle install on it.
this link here https://teamtreehouse.com/community/how-can-i-make-my-sinatra-app-public mentioned that I needed a Gemfile, and mentioned the contents of the Gemfile. And then to do bundle install. Then once that is done, then follow the instructions on that heroku blog post, of making the program file, and the config.ru and the git repo and doing heroku create (which also creates the remote), then git push heroku master.
i.e.
Gemfile as mentioned at treehouse link
# define our source to look for gems
source "http://rubygems.org/"
# declare the sinatra dependency
gem "sinatra"
And bundle install to install that Gemfile.
bundle install
hello.rb (as mentioned on heroku blogpost)
require 'rubygems'
require 'sinatra'
get '/' do
"Hello from Sinatra on Heroku!"
end
config.ru
require './hello'
run Sinatra::Application
git
$ git init
Initialized empty Git repository in /Users/adam/hello/.git/
$ git add .
$ git commit -m "sinatra and heroku, two great tastes"
[master (root-commit)]: created 93a9e6d: "sinatra and heroku, two great tastes"
2 files changed, 9 insertions(+), 0 deletions(-)
create mode 100644 config.ru
create mode 100644 hello.rb
heroku create
$ heroku create
Created http://severe-spring-77.heroku.com/ | git#heroku.com:severe-spring-77.git
Git remote heroku added
the push to heroku
$ git push heroku master
Counting objects: 4, done.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 385 bytes, done.
Total 4 (delta 0), reused 0 (delta 0)
-----> Heroku receiving push
-----> Verifying repository integrity... done, looks like a Rack app.
Compiled slug size is 0.1MB
-----> Launching....... done
App deployed to Heroku
To git#heroku.com:severe-spring-77.git
* [new branch] master -> master
For me it was an unused import in java app , removed the unused import and everything built fine.
In my case I had an npm script called "build" that had the as value npm run build --prefix client.
Heroku automatically executes the npm run build command and it couldn't build my React app. Probably because Heroku didn't install react-scripts module.
So I renamed the command to build-client and now I can push the changes to Heroku.
Checking you config vars (in heroku) may be a good idea.
I had the same error message, when I created a pipeline for my app and wanted to push to the newly created staging app. It didn't work because the config vars I had previously set were not transferred to the new staging app (obviously). After I added the variables once more, pushing to heroku git worked flawlessly again.
I had a similar issue with a recent application after running:
git push heroku master
The error:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to stormy-escarpment-13653.
remote:
To https://git.heroku.com/stormy-escarpment-13653.git
! [remote rejected] master -> master (pre-receive hook declined)
The problem was that I was in the wrong directory when I ran the command. I needed to be in the root of the application.
So I ran a git rm --cached <app_name>, to clean up and the ran again and it worked as expected.
My issue was I forgot to bundle install before pushing.
The steps which work for me
1: I just remove package-lock.json and yarn.lock
2: user npm install command
3: then push the changes to the github
4: use "git push heroku main" command.
to know more you can visit the below links enter link description here
My issue is that there was one file which I did not add in my previous git commit. The problem was fixed after I added that last file, and pushed another commit.
When I checked the logs, it showed this error:
remote: -----> Build
remote: Running build
remote:
remote: > student-app-frontend#0.1.0 build
remote: > react-scripts build
remote:
remote: Creating an optimized production build...
remote: Failed to compile.
remote:
remote: SassError: File to import not found or unreadable: ../../designUtils/fontDesign.
remote: on line 2 of src/components/studentCard/StudentCard.scss
remote: >> #import '../../designUtils/fontDesign.js';
remote:
remote: ^
remote:
remote:
remote:
remote: -----> Build failed
This shows that Heroku was not able to find the imported file 'designUtils/fontDesign.js'
This is because I used the command git commit -am 'latest changes' instead of using the commands git add., then git status to check if everything was added properly, and then git commit -m 'latest changes'
For me it solved by this command:
git push heroku master --force
or
git push heroku your_branch_name:master --force
Try Updating Node/php or any engines to latest version and then deploy again it will work for sure.
you need to mention the language in the root directory
how I fixed with
my python flask does not mention the requirments.text
Heroku detect the
Using buildpack: heroku/python
remote: -----> Python app detected
enter image description here

Resources