KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.

Composer token duration #911

Open Andrea Puggioni opened this topic on on Jun 7 - 20 comments

Andrea Puggioni commented on Jun 7

Hi, We use jenkins as continuous integration system that (at every commit) checkout the project source from git, launch composer update, execute unit tests and deploy to staging server.

Yesterday we removed koolreport pro from our repositories and start to require it with coposer but after 1 hour the builds started to fail because of token expiration.

We need a permanent token.

KoolReport commented on Jun 10

Understood the issue, we are working on the solution.

KoolReport commented on Jun 10

Dear Andrea,

You may try again now. Although the token still expired in 1 hour, it supposed not to cause error for composer.

Let me know if it works.

Toby Beresford commented on Jul 4

So are you saying that the token doesn't expire anymore? We use GitLab for CI and are concerned we'll hit the same problem

KoolReport commented on Jul 5

No the token is still expired in 1hour, just that it will not cause error and stop your building process. Please try to fix the version of KoolReport in your composer.json, it will be fine.

Toby Beresford commented on Jul 6

Heya

Hmm. It doesn't seem to work (I just bought the Excel package FYI). I had no problem downloading locally with auth.json etc. I've added auth.json into my repo so that the unit test runner has the ability to download using the same code.

This is what I'm seeing on the Pipeline when we try to run unit tests from within a Docker container:

Thanks for any help you can give.

  - Installing koolreport/core (4.0.0): Downloading (connecting...)Downloading (100%)         
  - Installing markbaker/matrix (1.1.4): Downloading (connecting...)Downloading (0%)           Downloading (5%)Downloading (10%)Downloading (15%)Downloading (20%)Downloading (25%)Downloading (30%)Downloading (35%)Downloading (40%)Downloading (45%)Downloading (50%)Downloading (55%)Downloading (60%)Downloading (65%)Downloading (70%)Downloading (75%)Downloading (80%)Downloading (85%)Downloading (90%)Downloading (95%)Downloading (100%)
  - Installing markbaker/complex (1.4.7): Downloading (connecting...)Downloading (0%)           Downloading (25%)Downloading (35%)Downloading (60%)Downloading (70%)Downloading (95%)Downloading (100%)
  - Installing phpoffice/phpspreadsheet (1.8.1): Downloading (connecting...)Downloading (0%)           Downloading (5%)Downloading (10%)Downloading (15%)Downloading (20%)Downloading (25%)Downloading (30%)Downloading (35%)Downloading (40%)Downloading (45%)Downloading (50%)Downloading (55%)Downloading (60%)Downloading (65%)Downloading (70%)Downloading (75%)Downloading (80%)Downloading (85%)Downloading (90%)Downloading (95%)Downloading (100%)
  - Installing koolreport/excel (6.0.0): Downloading (connecting...)Downloading (100%)             Failed to download koolreport/excel from dist: The checksum verification of the file failed (downloaded from https://repo.koolreport.com//dist/koolreport/excel/koolreport-excel-a5d55b459ab0a8daba9722688ceab73b64af78da-zip-c30ad3.zip)
    Now trying to download from source
  - Installing koolreport/excel (6.0.0): Cloning a5d55b459a

                                                                                                                                                                                                                                                                                                    
  [RuntimeException]                                                                                                                                                                                                                                                                                
  Failed to execute git clone --no-checkout 'git@github.com:koolreport/excel.git' '/builds/abc/vendor/koolreport/excel' && cd '/builds/abc/vendor/koolreport/excel' && git remote add composer 'git@github.com:koolreport/excel.git' && git fetch composer `
KoolReport commented on Jul 7

That's strange that it works from your local but not from your server. Let me inform the dev.team if they knows what might happens from the error.

David Winterburn commented on Jul 8

Hi Toby,

Would you please try to run "composer clear-cache" and "composer update" one time on your server? Thanks!

Toby Beresford commented on Jul 8

Hi David

It's a docker container so it's an entirely fresh install during the unit test process.

I've added the composer clear-cache to the install script.

See results:

I also just double checked - I removed the library from my local and then required it again. It all downloaded fine using that password.

Any other suggestions?

Thanks

Toby

David Winterburn commented on Jul 8

Hi Toby,

Is your token in auth.json newly active or expired? Please make sure the token is new for first time composer install.

In case the token is new and the error still happens, please change the install script to:

composer install --ignore-platform-reqs -vvv

and let us know the detail error message. Thanks!

Toby Beresford commented on Jul 8

Hi David

It's an expired token but when using Docker on GitLab surely it's always going to be a first time install? Every time it spins up a entirely fresh docker instance of the server to run the unit tests.

Does your authentication technology work with Docker instances?

I don't understand why you don't just stop the token expiring?

I will send the full job script to your email address.

Toby

Toby Beresford commented on Jul 8

It works fine on the unit test Docker instance if I use a new token however that doesn't solve my issue. I will see if it still works if I try the unit test pipeline again in one hour and report back.

Toby Beresford commented on Jul 8

Ok so that worked! Don't fully understand why, but it worked. Will now try in production. Thanks for your help.

KoolReport commented on Jul 8

Great that it works! Anything please let us know.

Toby Beresford commented on Jul 9

So the unit test with docker on gitlab worked in production yesterday but no longer works today. Are there any other solutions you can suggest? Is there a different auth method to the package we can use please? A permanent token would be ideal.

KoolReport commented on Jul 11

We will mark your idea as our suggestion. The expired token seems safer, may be we can increase the token validity time.

Toby Beresford commented on Jul 11

Safer for you but of no use to your customers!

You really need to say this when selling that it won't work in dockerised environments. Otherwise people are paying for something they can't use.

KoolReport commented on Jul 12

Understand. By the way, there is a quick solution that you move "koolreport" folder to outside of vendor folder. You can remove koolreport and excel package in composer.json. Of course, in somewhere, you need to include the koolreport manually with require_one "/path/to/koolreport/core/autoload.php"; By this way, you can avoid this token issue for now.

Toby Beresford commented on Jul 12

Aha ok will try that and report back.

Toby Beresford commented 7 days ago

Hi that avoids the issue for now but is obviously only a temporary solution so please let us know when you have a longer term fix.

KoolReport commented 7 days ago

Yeah, we will find a better solution

Give tips to supporter for his good work

If you feel that supporter has done a good work, consider giving him some credit. Any amount put into the tips box below is appreciated. By doing so, you have contribtuted to the existence of KoolReport and the quality of support.

Tips box
suggestion

None