repman-io / repman

Repman - PHP Repository Manager: packagist proxy and host for private packages
https://repman.io
MIT License
515 stars 107 forks source link

Found in the lock file but not in remote repositories #568

Open leopoiroux opened 2 years ago

leopoiroux commented 2 years ago

Hi, Since this morning, I get this message when I try to do a "composer update" on my project.

Problem 1
    - Root composer.json requires [my-private-dependency] ^5.11, found [my-private-dependency][5.11.4] in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.
Problem 2
    - Root composer.json requires [my-private-dependency] ^3.0, found [my-private-dependency][3.1.4] in the lock file but not in remote repositories, make sure you avoid updating this package to keep the one from the lock file.
Problem 3
    - ......

Is this due to a problem with the cloud version of repman at the moment? Thnks

gaetan-hexadog commented 2 years ago

same here :'(

philipp-brosig commented 2 years ago

Try to update every single package at repman. Has worked for me.

image

leopoiroux commented 2 years ago

Try to update every single package at repman. Has worked for me.

Thank you! I just did it on our 32 dependencies and it works.

thibodelanghe commented 2 years ago

Can't this be automated or solved along the repman side? i'm not manually updating 100+ dependencies. @akondas Do you have any insight?

thibodelanghe commented 2 years ago

@akondas @karniv00l Can someone look into this please? It interrupts our daily operations...

akondas commented 2 years ago

If you can share your organization alias with me, I can do it manually. If it is a standalone version, there is a command in cli that synchronizes the entire organization:

bin/console repman:package:synchronize-all --help
Description:
  Synchronize all packages

Usage:
  repman:package:synchronize-all [<organization>]

Arguments:
  organization          Organization alias

Options:
  -h, --help            Display help for the given command. When no command is given display help for the list command
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi|--no-ansi  Force (or disable --no-ansi) ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -e, --env=ENV         The Environment name. [default: "prod"]
      --no-debug        Switch off debug mode.
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
thibodelanghe commented 2 years ago

Hi @akondas, we use the cloud version, our alias is codedor. Thanks!

thibodelanghe commented 2 years ago

@akondas No longer needed. While waiting, I wrote something myself that uses the API to sync the packages...

ProxiBlue commented 2 years ago

Well, that was tedious, 100s of packages, manually updating each.

Kind of points to the need for a global 'update all packages' on the hosted version :)

ericp-mrel commented 2 years ago

@thibodelanghe Do you have a working link to the API docs? I'm just seeing an error message on their API docs landing page.

thibodelanghe commented 2 years ago

Not a full fledged page @ericp-mrel, but this did the trick for me https://app.repman.io/api/doc.json

ericp-mrel commented 2 years ago

@thibodelanghe Thanks!

swichers commented 2 years ago

Quick and dirty bash script to sync all packages. Assumes HTTPie and JQ are installed.

#!/bin/env bash
# Requires HTTPie and JQ

ORG_NAME='example'
API_KEY='DEADBEEF12345etc'
SLEEP_S=0.5

# End of variables that need to change

package_url="https://app.repman.io/api/organization/${ORG_NAME}/package"
result=`http -j "${package_url}" "X-Api-Token:${API_KEY}"`

while [[ true ]]
do
    for uuid in `echo "${result}" | jq -r '.data[].id'`
    do
        sync_url="${package_url}/${uuid}"
        echo "Syncing package ${sync_url}"
        http -j PUT "${sync_url}" "X-Api-Token:${API_KEY}"
        sleep "${SLEEP_S}"
    done

    next_link=`echo "${result}" | jq -re '.links.next'`
    if [ $? -ne 0 ]; then
        break
    fi

    echo "---- Fetching ${next_link}"
    result=`http -j "${next_link}" "X-Api-Token:${API_KEY}"`
done

echo "done"
exit 0
swichers commented 6 months ago

Slightly "safer" version of the above script is available here https://gist.github.com/swichers/c167abdb0f9be23305c7a9a22a473188 which pulls the org and key into arguments and checks for jq and http on the system before running.