Git:Heroku Repository or object not found: - node.js

Here is the error message from Heroku master push command
Git LFS: (0 of 5 files) 0 B / 167.50 MB
batch response: Repository or object not found: https://git.heroku.com/xxxx-brushlands-xx267.git/info/lfs/objects/batch
Check that it exists and that you have proper access to it
error: failed to push some refs to 'https://git.heroku.com/xxxx-brushlands-xx267.git'
Added a long text file to Git LFS (git for large files) and after that Heroku stopped working.
What might be the issue ?

A workaround:
git push heroku master --no-verify
This disables git-lfs pre-push hook. Metadata files are commited but binaries are not uploaded.
Then, as per upendra's answer, a buildpack can be used to download the files.

After alot of googling I found that the problem is with Heroku. If you are using Heroku, then Heroku doesn't support LFS and you have to look for alternatives.
I uploaded my long text file to dropbox and accessing it from there. Heroku should definitely look in to this issue.

I found a temporary solution to the problem of using Git LFS with Heroku. I am just putting it here just in case if people are still looking for it - https://github.com/git-lfs/git-lfs/issues/805
If that doesn't work, then try this out. This method worked for me - https://github.com/raxod502/heroku-buildpack-git-lfs

Related

Merged code from repo not updating in production server after push

I have a post-receive hook in my server.
I also have a remote repo(origin) (branch:stage) where another developer pushes to.
I pull the commits and push them to production from my local computer.
I recently created a new branch(feature) from the latest head of the existing branch(stage), added some code and pushed the feature branch to remote repo. I merged the new features from feature branch to stage branch.
Then I pulled from the remote repo to local.
Now, I pushed the stage branch to production.
My post-receive file consists:
git --work-tree=/path/to/project --git-dir=/path/to/project.git checkout -
f stage
My head in the remote repo after merge is currently at ae228b9.
And, at the remote production hook's latest logs also points to ae228b9.
The problem is that the code from the merge are not seen in the production server.
Do I have to do something else to get the merged code to production?
After I pulled from origin and pushed to production, I tried changing the new files locally, committed them and push to the server. But, the changes are not reflected in the server.
Edit:
Also, I uninstalled apache php mysql and installed them again. Before the unistallation/installation, the home page was showing in server but the routes were not working(404 error) but the git hook was working. After the unistallation/installation, the git hook stopped working
Update:
I created a new hook with the same code as above. Now during the push I get:
remote: error: unable to unlink old '.gitignore' (Permission denied)
remote: error: unable to unlink old '.htaccess' (Permission denied)
remote: fatal: cannot create directory at '.idea': Permission denied
I tried the following code inside my project folder and project.git(hook) folder:
sudo chmod -R ug+w .;
unable to link
after which the push is a success but the changes are not reflecting.
I solved this by deleting the contents of the project folder and pushing again with some new changes.
I faced the same issue(Azure deployment)
There are two ways to ways to handle this -
Increase timeout setting (but deployment may stuck some times)
Push new changes (redeployment)
I prefer 2nd option.

Unable to get all changed files details using GITLAB API

I have 29 changed files in one commit id and when I try to get all the details using below GitLab API then I am not getting all the files.
I am getting only 18 file details.
I tried with per_page=100&page=1 parameter but still not getting all changes.
GET /projects/:id/repository/commits/:sha/diff
Considering the GET /projects/:id/repository/commits/:sha/diff API is for getting the diff of a commit, check first locally (using git show --pretty) if you do see 29 or 18 files in the same commit present on your local cloned repo:
git show --compact-summary <SHA1>
If you don't see all the files there (meaning locally, not through GitLab) then some of some files were changed in other commits.

(remote rejected) master -> master (pre-receive hook declined), Push rejected, failed to compile Node.js app

I know that there's couple posts like this one, but solution of any of them works for me.
Here is what I receive when I go for git push heroku master:
Please support. Ignoring node_modules is not working.
Docpad app - package.json file is updated according to docpad's manual.
I also have Procfile set up as in the link above.
PS. I have tried to deploy docpad app via openshift, but while Im going with manual from http://docpad.org/docs/deploy/ I receive error at step 5.
The application 'appname' is configured for git reference deployments but the
artifact provided ('https://github.com/myusername/appname#master') is a url.
Please provide a git reference to deploy (branch, tag or commit SHA1) or
configure your app to deploy from binaries with 'rhc configure-app appname
--deployment-type binary'.
If I configure myapp to deployment-type binary it isnt working neither.
The plugin which heroku tries to install returned 404 and the installation fails due to that.
Verify that the plugin is indeed public and not something you have wrote or used locally.
There is no package with this name hosted on the registry you use.
Remove the line with "docpad-plugin-blah": "2" from your package.json file. That line was provided in the docs simply to show you how to install plugins, but there's no such plugin as blah.
"dependencies": {
"docpad": "6"
},
I strongly recommend that you read through the Getting Started on OpenShift to get an overview of the development workflow using Git.
That being said, and if you really meant to use git reference deployments and you know why you are using them, then read through the Managing Deployments section on the developers page of OpenShift and find out how to properly set up git reference deployments. For instance, 'https://github.com/myusername/appname#master' is not a valid git url and therefore it cannot be cloned.

Git Initial Push Bad File Descriptor Error

I am new to git and have been following various tutorials on setting up a centralized git server. For the past few days, I have been having trouble with the following error message:
Counting objects: 59, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (59/59), done.
Writing objects: 100% (59/59), 525.33 KiB | 0 bytes/s, done.
Total 59 (delta 15), reused 0 (delta 0)
remote: fatal: failed to read object 24e3826fe4be7dbaddbfcd698e943b5b8f9598ec : Bad file descriptor
error: unpack failed: unpack-objects abnormal exit
To ssh://git#[server url]/volume1/git/[project name]
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'ssh://git#[server url]/volume1/git/[project name]'
Initially, I used GitEye on my client side to manage git repository, but I encountered the problem when I tried to push my first commit to my linux server. So I played around with the permission and set the ownership of the whole git directory recursively to user "git". Nothing works. So I tried cloning a bare repository from the server and then try the push, but that didn't work either...returning me with unpacker error.
So I switch my software to Git Extensions and also trying the push on Git Bash...still the same error. Oh, forgot to mention that in the process, I deleted my local and remote git repository various times.
While one may argue that this may be a duplicate of git push over sshfs failing with “error when closing sha1 file: Bad file descriptor”, but I don't use sshfs and I am running Windows on my client side.
This may be a duplicate of Git push error - fatal: file '' write error: Bad file descriptor, but the push never works before.
UPDATE:
With mentioning about the version, I wonder if the version mismatch between the server and the client is the source of the problem. So I downgrade my client git version from 1.9.4 to 1.8.4.msysgit.0, but still found the problem after deleting and recreating a new git repository.
What interesting though is that I also tried to copy manually the git repository from the client to the server and do a git status on the remote side. As a result, I encounter the bad file descriptor, but that error didn't appear on the client side.
I found the source of the problems. I tried to do a first commit on my remote side and I got "not a valid object" error. Thus, I have a bad git build on my remote side. Thanks for your guidance. It points me the right path to look.
Now I have to figure how to get a newer (or different) version of git for my remote platform without having to use ipkg.

Git, having permission issues pushing

So I'm brand spanking new to Git and development in general. I'm a Linux and Mac user on a few different machines and have a couple cloud servers with AWS, I work on small little python projects on all of them.
I'll try to explain what I want first, hopefully I'm close to having the best solution that will work for my use case. I want to be able to write code on whatever device I own, Ubuntu desktop at home, work Macbook, cloud servers, Ubuntu desktop at work, and a personal Macbook. Obviously I'm working with different hostnames and usernames, I'm the only one that works on my code.
I went through the git guide and it's working, sort of. I tried to setup my repository on my cloud server which I will also be changing code on. I've been trying to commit and push from my Macbook but have been getting a string of permission errors all day, I've been having to go back to the repo and chown -R as my ssh wheel user since every object there is getting overwritten as root.
Here are some sample error messages I'm seeing when trying to push from my macbook:
A commit:
macbook:dev macbookuser$ git commit
# On branch master
# Your branch is ahead of 'origin/master' by 6 commits.
#
nothing to commit, working directory clean
And then the push:
macbook:dev macbookuser$ git push
user1#myserver-aka-repo.com's password:
Counting objects: 18, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (14/14), 1.62 KiB, done.
Total 14 (delta 7), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects
fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To user1#myserver-aka-repo.com:/home/myserver-aka-repo/dev/.git
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'user1#myserver-aka-repo.com:/home/myserver-aka-repo/dev/.git'
If the chown and umask 0002 don't fix this on the server, make sure the repo you are pushing to has been shared with the right mode.
git config core.sharedRepository
See "Git Push Error: insufficient permission for adding an object to repository database" for more on this option.
I usually set core.sharedRepository to umask, and set my umask to 0002.

Resources