0

I'm using Toran as a packagist proxy and as my main private repository listing. I have added a private component, hosted on bitbucket. The following is the component's composer.json:

{
    "name": "naroga/metronic-bundle",
    "authors": [
        {
            "name": "Pedro Cordeiro",
            "email": "<my email>"
        }
    ],
    "require": {},
    "autoload": {
        "psr-0" : {
            "Naroga\\MetronicBundle" : "src"
        }
    }
}

I have not tagged a single commit in this naroga/metronic-bundle component, as it's still very early in the development stage. I have then required it, using the following composer.json, in a different project:

{
    "repositories": [
        {"type": "composer", "url": "http://<my toran host>/repo/private/"},
        {"type": "composer", "url": "http://<my toran host>/repo/packagist/"},
        {"packagist": false}
    ],
    "name": "naroga/sample-project",
    "type": "project",
    "autoload": {
        "psr-0": { "": "src/", "SymfonyStandard": "app/" }
    },
    "require": {
        ...
        "naroga/metronic-bundle": "dev-master"
    },
}

I don't want to lower the minimum-stability, for I'm requiring many other components that should remain stable.

When I run a simple composer update -vvv in my project, composer correctly downloads my project's composer.json, as noted below:

Downloading http://<my toran host>/repo/packagist/p/naroga/metronic-bundle.json

But, at the end, it always throws this error:

Problem 1
 - The requested package naroga/metronic-bundle could not be found in any version, there may be a typo in the package name.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

I don't want to add any tags, nor do I want to lower the project's minimum-stability. How do I proceed to be able to install this package?


composer show naroga/metronic-bundle -vvv shows the output below:

C:\Apache24\htdocs\naroga>composer show naroga/metronic-bundle -vvv
Reading ./composer.json
Loading config file C:/Users/pedro.cordeiro/AppData/Roaming/Composer/auth.json
Loading config file ./composer.json
Executing command (CWD): git describe --exact-match --tags
Executing command (CWD): git branch --no-color --no-abbrev -v
Executing command (CWD): git rev-list master..outer-blog-view
Failed to initialize global composer: Composer could not find the config file: C:/Users/pedro.cordeiro/AppData/Roaming/Composer/composer.json
To initialize a project, please create a composer.json file as described in the http://getcomposer.org/ "Getting Started" section
Downloading http://<my toran host>/repo/private/packages.json
Writing C:/Users/pedro.cordeiro/AppData/Local/Composer/repo/http---<my toran host>-repo-private/packages.json into cache
Downloading http://<my toran host>/repo/packagist/packages.json
Writing C:/Users/pedro.cordeiro/AppData/Local/Composer/repo/http---<my toran host>-repo-packagist/packages.json into cache
Downloading http://<my toran host>/repo/private/p/naroga/metronic-bundle.json
Writing C:/Users/pedro.cordeiro/AppData/Local/Composer/repo/http---<my toran host>-repo-private/provider-naroga$metronic-bundle.json into cache
Downloading http://<my toran host>/repo/packagist/p/naroga/metronic-bundle.json
Downloading http://<my toran host>/repo/packagist/p/naroga/metronic-bundle.json
name     : naroga/metronic-bundle
descrip. :
keywords :
versions : dev-master
type     : library
license  :
source   : [git] https://naroga@bitbucket.org/naroga/metronic-bundle.git c8cc1d66cae1e24b7f4039b690c999a083dd5775
dist     : [zip] http://<my toran host>/repo/private/dists/naroga/metronic-bundle/9999999-dev/c8cc1d66cae1e24b7f4039b690c999a083dd5775.zip c8cc1d66cae1e24b7f4039b690c999a083dd5775
names    : naroga/metronic-bundle

autoload
psr-0
Naroga\MetronicBundle => src
Pedro Cordeiro
  • 2,085
  • 1
  • 20
  • 41

2 Answers2

2

First of all you can figure out whether the package is visible at all using:

composer show naroga/sample-project

If it does not list anything, then it means it does not exist at all in your Toran repo and that might indicate you misconfigured it there or just forgot to add it to Toran.

The following line in itself does not mean much, it just means composer is looking for that package in the toran repo but it's not a guarantee that it exists: Downloading http://<my toran host>/repo/packagist/p/naroga/metronic-bundle.json

Seldaek
  • 40,986
  • 9
  • 97
  • 77
  • It does show the package. This is `composer show naroga/metronic-bundle -vvv` from inside the sample project folder: https://gist.github.com/naroga/afc1ec2eaa1659d1053e – Pedro Cordeiro Feb 10 '15 at 11:24
0

As it turns out, toran-proxy does not handle private repositories in a lazy way, like it does with packagist repositories.

So, after adding a new private repository, running php bin/cron or php app/console toran:cron is a MUST.

I've resyncd the repositories running this simple command, and my package is now visible.

Pedro Cordeiro
  • 2,085
  • 1
  • 20
  • 41
  • Ah I see, yes that's indeed necessary, unless you set up a hook in the git repo so that it tells toran to update every time you push changes. – Seldaek Feb 10 '15 at 15:11