Exporting dependencies from package which is existing vendor - go

I am new to golang and glide dependency management tool. I am trying to run glide install in created my company project. I have met an error about go-xorm library.
[ERROR] Update failed for github.com/go-xorm/xorm: Unable to get repository: Cloning into '/Users/xxx/.glide/cache/src/https-github.com-go-xorm-xorm'...
remote: Repository `go-xorm/xorm' is disabled.
remote: Please ask the owner to check their account.
fatal: unable to access 'https://github.com/go-xorm/xorm/': The requested URL returned error: 403
: exit status 128
[ERROR] Failed to checkout packages: Unable to get repository: Cloning into '/Users/xxx/.glide/cache/src/https-github.com-go-xorm-xorm'...
remote: Repository `go-xorm/xorm' is disabled.
remote: Please ask the owner to check their account.
fatal: unable to access 'https://github.com/go-xorm/xorm/': The requested URL returned error: 403
: exit status 128
It's seem that I am not able to download it from github because the owner made it disabled to clone.
How can I fix this error or Is there any way to export directly from local vendor without fetching from github. I am sure that the package is already on my local vendor folder. Thank you so much!!!

This is because XORM moved from Github (repo is still available as Public Archive) to Gitea and instead of github.com/go-xorm/xorm they now use xorm.io/xorm.
I'd recommend to stop using glide completely and replace it with Go Modules based workflow; but if you must use it, you will need to remove github.com/go-xorm/xorm from your glide.yaml, add xorm.io/xorm (you can use glide get to do so) and fix your imports everywhere in codebase.

Related

Go get from GCP source repositories

I'm trying to go get a repository from GCP Source repositories.
This seems to be very very poorly documented but what I tried to do was running go get source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git.
But I got the error:
go: downloading source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git v0.0.0-20210621185528-a62b060bc13d
go get: source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git#v0.0.0-20210621185528-a62b060bc13d: verifying
module: source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git#v0.0.0-20210621185528-a62b060bc13d: reading https://sum.golang.org/lookup/source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git#v0.0.0-20210621185528-a62b060bc13d: 410 Gone
server response:
not found: source.developers.google.com/p/[MY-PROJECT]/r/[MY_REPO].git#v0.0.0-20210621185528-a62b060bc13d: invalid version: git fetch -f origin refs/heads/:refs/heads/ refs/tags/:refs/tags/ in /tmp/gopath/pkg/mod/cache/vcs/3eb4fda67ba3d1beb54fafd4a7594a34c06a66c44b1ffd91759a1b7362ecfa4d: exit status 128:
fatal: unable to connect to source.developers.google.com:
source.developers.google.com[0: 173.194.200.82]: errno=Connection refused
source.developers.google.com[1: 2607:f8b0:4003:c0d::52]: errno=Connection refused
How can I make it work?
Fixed by adding GOPRIVATE=source.developers.google.com. Seems that go mod was trying to use a public connection which was being refused by Source.

Cannot upgrade or otherwise change tex-live installation on Heroku

Pushes of updates to my app to Heroku are now rejected because of a tex-live incompatibility. See the error message below.
Heroku error message
remote: tlmgr: Remote repository is newer than local (2018 < 2019)
remote: Cross release updates are only supported with
remote: update-tlmgr-latest(.sh/.exe) --update
remote: Please see https://tug.org/texlive/upgrade.html for
details.
remote: ! Push rejected, failed to compile TeX Live app.
I have tried the following:
Add a file texlive.repository with contents ftp://tug.org/historic/systems/texlive/2018/tlnet-final. This does not work because the texlive repository lacks a required cryptographic certificate.
Delete the texlive buildpack and start over. Below is my buildpack config. However, when I try to remove it, I get this message:
$ heroku buildpacks:remove syphar/heroku-buildpack-tex
› Error: invalid json response body at https://buildpack-registry.heroku.com/buildpacks/syphar%2Fheroku-buildpack-tex reason: Unexpected end of JSON input
At this point I am stuck!
Heroku buildpacks
$ heroku buildpacks
=== nshost Buildpack URLs
1. https://github.com/HashNuke/heroku-buildpack-elixir.git
2. https://github.com/syphar/heroku-buildpack-tex.git
This works: in the file texlive.packages, replace
ftp://tug.org/historic/systems/texlive/2018/tlnet-final
with
https://www.math.utah.edu/pub/texlive/historic/systems/texlive/2018/tlnet-final
Solution courtesy of Nelson Beebe, University of Utah Mathematics Department

Haskell on Windows - Stack fails to fetch package index

I'm trying to install Haskell on Windows. Downloaded the installer and just clicked through everything, then tried to use Stack to install a package, ran it from a temporary folder in which everything has write access:
C:\t>stack install hfmt
Using latest snapshot resolver: lts-8.3
Writing implicit global project config file to: C:\sr\global-project\stack.yaml
Note: You can change the snapshot via the resolver field there.
Downloaded lts-8.3 build plan.
Fetching package index ...=.git""=="gui" was unexpected at this time.
C:\sr\indices\Hackage\git-update\all-cabal-hashes>#if ""--git-dir=.git""=="gui" #goto gui
Process exited with ExitFailure 255: C:\Program Files (x86)\Git\cmd\git.CMD --git-dir=.git fetch --tags
Failed to fetch package index, retrying.
removeDirectoryRecursive: permission denied (Access is denied.)
What's going wrong, and how can I fix it? Or should I forget about Stack and just use Cabal instead?
Tried rerunning the command as administrator. This time the response was instant:
C:\t>stack install hfmt
Fetching package index ...=.git""=="gui" was unexpected at this time.
C:\sr\indices\Hackage\git-update\all-cabal-hashes>#if ""--git-dir=.git""=="gui" #goto gui
Process exited with ExitFailure 255: C:\Program Files (x86)\Git\cmd\git.CMD --git-dir=.git fetch --tags
Failed to fetch package index, retrying.
removeDirectoryRecursive: permission denied (Access is denied.)

Git pull error: unable to create file (Invalid argument)

I am trying to sync remote repo with local repo but getting following errors. Some files (which have not extention) are not getting sync with local repo on WINDOWS machine, but I could sync successfully on MAC machine.
Is there any configuration settings in WINDOWS to handle such case?
Using TortoiseGit
Windows 7 64 bit machine
ERROR DETAILS
git.exe clone --progress -v "https://github.com/xxxx/xxxxx.git" "C:\Data\GitHub\simility\vishesh-common"
Cloning into 'C:\Data\GitHub\simility\vishesh-common'...
POST git-upload-pack (200 bytes)
remote: Counting objects: 3912, done.
remote: Compressing objects: 100% (487/487), done.
Receiving objects: 100% (3912/3912), 2.70 MiB | 567.00 KiB/s, done.
Resolving deltas: 100% (1578/1578), done.
remote: Total 3912 (delta 409), reused 0 (delta 0)
Checking connectivity... error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030050305_fantasy-trilogy-spin?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030295038_laser-dogs?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030315317_arizona-native-bird-painting-series?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030315317_native-birds-ii?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_ikeyboard-0?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_ikeyboard?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_only-you-can-prevent-computercide?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030552097_vector-cupholder-protect-your-laptop-and-your-lap?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_103055429_death-of-an-angel?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030650665_rachel-vanslyke-making-a-new-record-together-we-ca?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1030835091_russian-trucks-of-world-war-two?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1031873800_prop-expansion-next-level?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1031873800_prop-project-expansion?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1099860912_yaw-clock?ref=users (Invalid argument)
error: unable to create file kickstarter/parsers/data/kickstarter/campaigndetails/_projects_1099992656_heavenly-sight-a-vision-out-of-blindness?ref=users (Invalid argument)
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status' and retry the checkout with 'git checkout -f HEAD'
git did not exit cleanly (exit code 128) (21746 ms # 29-09-2014 13:32:13)
I ran into the same problem, but wasn't willing to rename or delete these files. So here's a workaround in case you can live without accessing those files using a sparse-checkout:
Go to the .git folder in your repo and open the file config. (You can also edit your configuration using tortoise-git, but I havn't got it installed here.) In the [core]section add the line
sparsecheckout = true
then go to the folder .git/info and create the file sparse-checkout. Add something like
*
!kickstarter/parsers/data/kickstarter/campaigndetails/*
The first line includes everything, while the second excludes all files in kickstarter/parsers/data/kickstarter/campaigndetails/. You should now be able to checkout the repo. Using wild-cards you can probably do more sophisticated excludes.
If I read that log well, those files have names that end with "?ref=users"
Windows does not allow you to have a '?' in a filename, just like it does not allow to have a "\" or "*". Under Linux it is possible, if you escape those characters. On Windows, I think it's not possible at all. See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247
You will have a hard time with such names.. I actually can't come up with any idea that would allow you to sync that 1:1. You certainly can fetch them and save them under some safe names like _projects_1099992656_heavenly-sight-a-vision-out-of-blindness__ref=users but I don't know how to do that automatically, or how to later inform Git about that mapping, sorry..
These filenames look like they have a HTML-query-parameters suffixed to them. Is it really required? maybe that's just some artifact that could be removed? try talking to the mantainers of the project, maybe they will be able to simply remove that odd suffix?
I'm using bitbucket and it has function that you can delete a problem file.
This is what I do.
Go to your repository.
Choose menu "commit".
Select your branch that you want to remove problem file.
Go to your file and click it. You will reach the file overview that show the detail of the file e.g. your code, date time of this file committed, etc.
Look at upper right corner, you will see the button with arrow down image (similar to alphabet v) click it.
It will dropdown and show you rename button and delete button inside it.
Then it's your choice, will rename it or delete it. Choose wisely.
After you click a button. Bitbucket will show you a dialog box do as it said and commit your file with commit button.
After commit you can return to sourcetree and pull your code with no problem.
Enjoy!
For me, this error occured when I was working on Windows machine. And git repo was cloned inside One-Drive. Altimately, after changing git location to outside One-Drive worked for me. Somehow, One-Drive couldn't update the file index I was trying to commit. Either you can try outside of One-Drive location or try resetting to previous commit and then update.
In general if you get this git "invalid argument" error on Windows, try making sure your /.git/ folder is not set to "read only". This fixed it for me.
I ran into this and tried a few of the solutions above with no success.
What I did is weird but worked for me, I:
Copied all my changes for the 1 file I had issues to notepad
Reverted changes in GIT
Copied the text from notepad with my updated code
Saved the file with the changes again
Used Git Desktop to push the changes
This time it worked.
I did this for 2 different files and it worked for me at least. Easy/quick thing to try before you try the others if you only have a file or 2 causing the issues.
I was also facing "Git: unable to write file, invalid object" and try many ways but nothing has been worked. Alterably I tried simple way i have created new repo folder at my local and take checkout again of the branch and implement changes. then commit and it works.
Please note before doing just take back of the changes or if you are creating new folder for repo then dont delete till your changes committed into folder.
Something similar happened to me locally: I was suddenly unable to do git add -A and got this message:
error: unable to write file .git/objects/99/8fe363fa337daab318f7fc378727d9dcce28d5: Invalid argument
error: [some file].js: failed to insert into database
error: unable to index file '[some file].js'
fatal: adding files failed
I removed the file from the repo (temporarily copied it elsewhere), commited and pushed the repo (without the problematic file) to GitHub. Then, in GitHub, I manually added the file and commited.
At this point, pulling to my local machine failed. I deleted the directory/repo and got a fresh clone from GitHub. It's a weird solution but it seems to work.

Deploy meteor/meteorite 0.8.3 to heroku

I just updated my app to meteor 0.8.3. Locally it runs without problems. But when I try to push it to heroku, I'll get the following error:
Building meteor bundle
simple-schema: updating npm dependencies -- string...
iron-router: updating npm dependencies -- connect...
lodash: updating npm dependencies -- lodash...
Errors prevented bundling:
While building the application:
error: no such package: 'accounts-ui-bootstrap-3'
error: no such package: 'accounts-entry'
While building package `iron-dynamic-template`:
error: no such package: 'blaze'
tar: /app/tmp/cache/bundle.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Exiting with failure status due to previous errors
! Push rejected, failed to compile Meteor app app
For deployment, I used the buildpack of oortcloud. This worked proper in the past. https://github.com/oortcloud/heroku-buildpack-meteorite
I'm most confused by the earlier log entries before the error happens. Here it says that Meteor 0.8.1.1 is being installed. A couple of lines after that it confirms that Meteor 0.8.3 has been installed. I'm pretty sure that this is the same issue like this. https://github.com/EventedMind/iron-dynamic-template/issues/2
Installing Meteor 0.8.1.1
* 'meteor' build tool (vers
* 'meteor' build tool (version 43b8566b9f)
* Package updates: accounts-base accounts-meteor-developer accounts-oauth
accounts-password accounts-ui accounts-ui-unstyled amplify appcache
application-configuration autoupdate browser-policy browser-policy-common
browser-policy-content check coffeescript coffeescript-test-helper ctl
ctl-helper deps ejson email facebook facts follower-livedata force-ssl github
google html-tools htmljs http jquery-waypoints js-analyze less livedata
localstorage logging meetup meteor meteor-developer minifiers minimongo
mongo-livedata oauth oauth-encryption oauth1 oauth2 observe-sequence
reactive-dict routepolicy session showdown spacebars spacebars-compiler
spacebars-tests spiderable srp star-translate stylus templating test-helpers
test-in-browser tinytest twitter ui underscore-tests webapp weibo
Meteor 0.8.3 has been installed in your home directory (~/.meteor).
Now you need to do one of the following:
(1) Add ~/.meteor to your path, or
(2) Run this command as root:
cp ~/.meteor/tools/latest/launch-meteor /usr/bin/meteor
Then to get started, take a look at 'meteor --help' or see the docs at
docs.meteor.com.
I also tried to create a new meteorite app to get rid of dangling dependencies. But without success!
What can I do? Is there a chance to debug the push/deploy on the heroku server?
The outdated file .meteor/release caused the problem:
git heroku push master fetches the files to deploy from the origin git repository. It doesn't care about local, unstaged files. Somehow the file .meteor/release has not been pushed to the origin repository. So during the installation routine at heroku the meteor version was 0.8.1.1 and not 0.8.3.
Solution to avoid this problem:
Check/Add the files .meteor/release and .meteor/packages to your origin git repo
Test only what's in your origin repo before you deploy it. Use git pull

Resources