Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bffake1999 opened this issue Jul 29, 2021 · 6 comments

Comments

@bffake1999
Copy link

bffake1999 commented Jul 29, 2021

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.

@alcohol
Copy link
Member

alcohol commented Jul 29, 2021

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.

@bffake1999
Copy link
Author

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

@alcohol
Copy link
Member

alcohol commented Aug 2, 2021

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?

@hannius
Copy link

hannius commented Aug 5, 2021

it should be a grammatical mistake

@bffake1999
Copy link
Author

bffake1999 commented Aug 6, 2021

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?

@alcohol
Copy link
Member

alcohol commented Aug 7, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants