composer / satis

Simple static Composer repository generator - For a full private Composer repo use Private Packagist

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not valid JSON error from package during composer install from Satis Repo

bffake1999 opened this issue · comments

Describe the bug
I get an error when I try to install composer dependencies from a Satis Repo. Both are hosted on my local machine. When I run composer install, it throws an error:

 [Seld\JsonLint\ParsingException]
  “http://localhost:4680/p2/symfony/polyfill-mbstring.json” does not contain valid JSON
  Parse error on line 856:
  ...            },     {    “packages”: {
  ---------------------^
  Expected: ‘STRING’ - It appears you have an extra trailing comma

This only happens on one Linux machine running Centos 7. It works correctly on my MAC.

To Reproduce
Satis.json

{
  "name": "dylan/composermirror",
  "homepage": "https://localhost:4680",
  "repositories": [
    {
      "type": "composer",
      "url": "https://packagist.org"
    }
  ],
  "require": {
    "phpunit/phpunit": "<15.0",
    "behat/behat": "<20.0",
    "blueday/behat-html-formatter": "dev-master",
    "behat/mink": "1.7.*@stable",
    "behat/mink-extension": "<20.0",
    "behat/mink-goutte-driver": "<20.0",
    "behat/mink-selenium2-driver": "<20.0",
    "guzzlehttp/guzzle": "<20.0",
    "rtheunissen/guzzle-log-middleware": "<10.0",
    "namshi/cuzzle": "<10.1",
    "psr/log": "<10.1",
    "monolog/monolog": "1.*.*",
    "envms/fluentpdo": "1.*.*",
    "allure-framework/allure-behat": "<10.1",
    "bentools/guzzle-throttle-middleware": "<10.0",
    "couscous/couscous": "<10.1",
    "google/apiclient": "<10.1"
  },
  "require-dependencies": true,
  "require-dev-dependencies": true
}

Composer.json on client to download from Satis:

{
  "name": "tem/p",
  "description": "test123",
  "repositories": [
    {
      "type": "composer",
      "url": "http://localhost:4680/"
    }
  ],
  "require": {
    "sebastian/diff": "^4.0",
    "behat/behat": "<20.0"
  },
  "config": {
    "secure-http": false
  }
}

Outcome
After running composer install on the client, it should install without problem but I get the error listed above.

Additional context
PHP Version 7.3.28
Composer Version 2+
I have used multiple version of Composer 2.x+ and it happens with all of them.
Does anybody have any ideas about what causes this error? Is it due to a versioning error or a Linux config error? This bugs happens with 99% of packages I add to my dependency list.
Thanks.

commented

I can't use any of your example config files because you have a weird editor I think and it replaced all regular " characters with something curly.

I can't use any of your example config files because you have a weird editor I think and it replaced all regular " characters with something curly.

Sorry! I have updated it now. Thanks

commented

Unfortunately my build output only contains valid JSON files. Perhaps you can share the generated JSON file that contains the issue so we can identify in what way the JSON is not valid?

it should be a grammatical mistake

What operating systems are you using @alcohol ? It seems to be only on one operating system it fails on as it works on Mac OS for me. I have pulled the json files and validated them myself. They are identical on my Mac version and Centos 7 version.

@hannius What do you mean?

commented

I run Archlinux but 99% of the time I run Composer / Satis inside Docker containers which means it runs on Alpine.