Laravel Nova installation via composer fails on production server - laravel

I have added Laravel Nova to our application and purchased a license. On the local server everything works perfectly. However, when I try to deploy the updated application to our linux server and run composer update it says:
Failed to download laravel/nova from dist: /var/www/{myPath} does not exist and could not be created.
Now trying to download from source
Syncing laravel/nova (3.29.0) into cache
Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
Head to https://github.com/settings/tokens/new It will be stored in "/var/www/{myPath}"
So I created a GitHub Token and added the Laravel Nova credentials to the auth.json file on the server too. Everything should be correct and it is working on the local copy as I said before. However, I am getting the following errors:
[RuntimeException]
Failed to execute git clone --mirror -- 'git#github.com:laravel/nova.git' '/var/www/{myPath}/.cache/composer/vcs/git-github.com-laravel-nova.git/'
Cloning into bare repository '/var/www/{myPath}/.cache/composer/vcs/git-github.com-laravel-nova.git'...
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
How could I solve this problem?

Deleting the /vendor directory and the composer.lock file and running composer install --optimize-autoloader --no-devsolved the problem.

I had a similar problem and finally figured out the cause and its due to the laravel/nova:3.29. A minor upgrade to 3.30 fixed the issue for me without having to delete the whole composer.lock file as it will update some other packages as well.

Create file at root directory with name "auth.json"
copy your nova credentials to it
{
"http-basic": {
"nova.laravel.com": {
"username": "email",
"password": "passsword"
}
}
}
composer update

Related

Removing AWS secret manager from laravel project

I've cloned a laravel project from github private repo and trying to setup on my local. The project uses AWS secret manager, so when I try to run composer install I get secret manager error in WrappedHttpHandler.php and RequestException.php vendor files. I removed aws from composer.json file and deleted aws.php file from the config folder. But still can't run composer install command for setuping the project on my local machine.
So, do you know guys how to remove secret manager package from the Laravel(version 5.7) project?

I am trying to build using docker desktop on Mac

But it seems to get the following error. I have cloned the package and have access rights to it.
failed to load cache key: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
EDIT
This error seems to be due to docker on M1 chip and not because of any repo access. The error is same when I run getting-started guide. I can't build anything using Docker for Desktop on Mac.
EDIT 2
I tried building with sudo and it worked fine. The error seems to be with Repository builds as they don't use sudo and I have been updating DOCKER_BUILD_SUDO=sudo but the issue persists.
The problem is not the access to the repository, but to the image registry:
pull access denied ... insufficient_scope
If you have the credentials, prior to building issue a docker login command. If not, you'll need to either ask for them the maintainer or you're out of luck unless you find an alternative (public) image and replace it in the Dockerfile.

Laravel Spark - Cannot connect to repo

So, I recently made two big changes ... moved my code from bitbucket to github, and set up a pipeline on heroku with a new staging app (original app is now production).
I got a new github token and placed it into the auth.json file as was done with the previous bitbucket repo (it's a private repo). However, when I push to heroku to build the code with composer there, I cannot connect with the laravel spark repo.
Error:
Installing laravel/spark (v3.0.5): Downloading (failed) Failed to download laravel/spark
from dist: The "https://api.github.com/repos/laravel/spark/zipball/512af184c15d793c33328ff03313553ea6feacba"
file could not be downloaded (HTTP/1.1 404 Not Found)
Now trying to download from source
Installing laravel/spark (v3.0.5): Cloning 512af184c1
[RuntimeException]
Failed to execute git clone --no-checkout 'https://***:***#github.com/laravel/spark.git' '/tmp/build_9916d292e7eb72e0fbe34f47e3d9854c/vendor/laravel/spark' && cd '/tmp/build_9916d292e7eb72e0fbe34f47e3d9854c/vendor/laravel/spark' && git remote add composer 'https://***:***#github.com/laravel/spark.git' && git fetch composer
remote: Repository not found.
fatal: repository 'https://***:***#github.com/laravel/spark.git/' not found
What I have tried ...
Setting the github api token on heroku with
heroku config:set GITHUB_API_TOKEN=<token>
Setting the composer github token
composer config -g github-oauth.github.com <token>
I am connected to the Laravel Spark repo on github and when I run composer on my local machine I am not prompted for a spark token. Every other dependency that I have runs fine - I can change the auth.json and that is not the case, so I don't think this is a problem with lack of access to my github.
Does anyone know how Laravel - Spark checks to grant access and how we can check to see where we are going wrong? There should be a checklist of things that can be looked at if access is denied.
Any help is appreciated. Been stuck for almost a week. I really need some way to figure out how to connect to the Spark repo.
(Edit) Spark is a composer satis repo. I can't really find any info on how to prompt this type of repo to tell me why I can't clone it or how best to communicate with it.
(Edit 2) Also tried changing the git config to ensure that it had the right token. This should be overwritten by the files, but I tried it anyway.
git config github.accesstoken <token>
The response from the software providers is to use an alternative method and place the code under my source control so that composer is not trying to load it. I do not wish to do this for a number of reasons. Again, I need a way to clone the satis repo in composer.
Edit 3: I have also tried going to the URL of the repo and attempting to access one of the versions. This displays the same error as when you go to the URL in the error directly (it's the same URL).
{
"message": "Not Found",
"documentation_url": "https://developer.github.com/v3/repos/contents/#get-archive-link"
}
This seems to back up the belief that this is not a composer issue, but something to do with a github setting or spark setting.
Edit 4: It occurred to me that my problems started after upgrading to V6 and I am getting denied access to the spark repo containing versions 1-5 and version 6 is separate. I upgraded my spark version to 6 and had access to that repo. I then tried uploaded the code base to heroku that had version 6 but was denied access to the repo there.
I also tried ...
heroku config:set github_oauth=<token>
Edit 5: I noticed that the output from pushing to heroku included the phrase
NOTICE: Using $COMPOSER_GITHUB_OAUTH_TOKEN for GitHub OAuth.
In response, I found an article asserting that the oauth token should be set in the config portion of composer.json as ...
"config": {
"github-oauth": {
"github.com": "<token>"
}
}
I tried it, but it didn't work
So, it turns out there were several issues. The final big one was that for some reason, I had to delete my api personal token used for github access and create a new one with full privileges for everything. Once that was set up, I had access and was able to reduce the privileges to repo only.
https://github.com/ladybirdweb/agorainvoicing Use open source Agora Invoicing software. It has all the tools you need to start software selling business. It is build on Laravel framework and is very similar to Laravel Spark

Issue Deploying with Laravel Forge

I am trying to deploy a Laravel PHP Project with Laravel Forge. I have connected to my repository on github correctly. However, when I hit deploy, if I go to the public IP for the site, I just see:
"No input file specified."
on the page.
I do not know why it is exhibiting this behavior.
If I go to the latest deployment log, I see:
/home/forge/.forge/provision-433327.sh: line 1: cd: /home/forge/default/laravel: No such file or directory
fatal: Not a git repository (or any of the parent directories): .git
Composer could not find a composer.json file in /home/forge
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section
Could not open input file: artisan
However, I do have a composer.json file in my laravel folder....
Any ideas? Thank you in advance.
It looks like the /home/forge/default/laravel directory doesn't exist. Could you ssh in and verify that the directory exists?
These are the commands that the default forge deploy script runs:
cd /home/forge/default
git pull origin master
composer install
php artisan migrate --force
It looks like your deploy script is navigating to /home/forge/default/laravel instead.

Deploying Laravel 4 on shared hosting server (hostgator)

I would appreciate your help. I really don't know where else to turn to. I can't deploy a L4 app to Hostgator. I read the guide on the forums, but my shared HG account already has many apps under public_html so deleting it would be catastrophic and a risk I cannot afford to play with.
Is there a way to deploy L4 app like any other normal apps?
What I am trying to do is the following:
home/myuser/public_html/domain.com/laravel/ <--- where the app should live
home/myuser/public_html/domain.com/laravel/dev <--- dev environment
in both of these folders there is a separate git repository (via ssh). with remotes dev and prod
so what I simply want to achieve is:
git push prod
and
git push dev
but when I push, I am getting a message:
dev/bootstrap/../vendor/autoload.php) [function.require]: failed to open stream: No such file or directory
/dev/bootstrap/../vendor/autoload.php' (include_path='.:/opt/php53/lib/php') in
Turns out I had not installed Composer properly.
I solved this by:
adding alias to php 5.3 in .bashrc:
alias php53='/opt/php53/bin/php'
installing Composer:
curl -sS https://getcomposer.org/installer | php53
in composer.json, in the "scripts" replacing php with: /opt/php53/bin/php (alias is not accepted, do not know why)
running
php53 composer.phar install
adding to .htaccess:
AddType application/x-httpd-php53 .php
I created a repository to simplify the installation process(mostly for future visitors) after struggling with it several times.
You can find the repository at https://github.com/ralphowino/laravel-for-hostgator-users or download it via https://github.com/ralphowino/laravel-for-hostgator-users/archive/master.zip

Resources