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

Errors when uploading packages #73

Open
bkraul opened this issue Jun 5, 2019 · 21 comments
Open

Errors when uploading packages #73

bkraul opened this issue Jun 5, 2019 · 21 comments
Assignees
Labels

Comments

@bkraul
Copy link

bkraul commented Jun 5, 2019

I am getting an Got error 'PHP message: PHP Warning: implode(): Invalid arguments passed in /app/src/inc/api_nuget.php on line 128\nPHP message: PHP Warning: implode(): Invalid arguments passed in /app/src/inc/api_nuget.php on line 128\n' when trying to upload packages. As a result the push operation fails.

This started happening after the last set of changes (092f2c1) where this was introduced:

if(is_string($e->ReleaseNotes)) {
	$t = str_replace("\${NUSPEC.RELEASENOTES}", htmlspecialchars($e->ReleaseNotes), $t);
}else{
	$t = str_replace("\${NUSPEC.RELEASENOTES}", htmlspecialchars(implode(" ",$e->ReleaseNotes)), $t);
}

Other subsequent errors are:

Got error 'PHP message: PHP Notice:  Undefined index: sizeBytes in /app/src/inc/commons/uploadutils.php on line 55\nPHP message: PHP Notice:  Trying to get property of non-object in /app/src/inc/nugetreader.php on line 192\n'

However, this one is possible just a result of the original failure.

@bkraul
Copy link
Author

bkraul commented Jun 5, 2019

Hmmm...I reverted the line in api_nuget.php to what it was before the commit, but the second error is still happening, and the push operation is still failing. Neither uploadutils.php nor nugetreader.php seem to have recently changed. Any ideas?

@kendarorg
Copy link
Owner

Mmmh can you give me the nuspec file of the package you are trying to upload?

@bkraul
Copy link
Author

bkraul commented Jun 5, 2019

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
  <metadata>
    <id>EPG.CommonLibrary</id>
    <version>1.1.21.7096</version>
    <title></title>
    <authors>EPG Internal Development</authors>
    <owners>EPG Internal Development</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>Common code library for EPG applications.</description>
    <copyright>Copyright ©  2016 EPG Insurance, Inc.</copyright>
  </metadata>
</package>

The packages were uploading fine up to the last couple of commits.

@kendarorg
Copy link
Owner

I think this could result from the absence of the field on the nuspec, i think that a call to if(is_array( on the else could do the work ... this was generated by another guy having an array for the release notes (i always like the clarity and precision of the nuspec specifications :P )

@bkraul
Copy link
Author

bkraul commented Jun 5, 2019

hmmm...let me try adding the field and see if it works.

@bkraul
Copy link
Author

bkraul commented Jun 5, 2019

So, adding the field <releaseNotes/> did remove the original releaseNotes error, but it still fails with the second error.

@bkraul
Copy link
Author

bkraul commented Jun 5, 2019

This is the command I am using:

.\nuget.exe push .\packages\*.symbols.nupkg [mykey] -source http://my.nugetserver.com/upload

@kendarorg
Copy link
Owner

kendarorg commented Jun 5, 2019

http://sandbox.onlinephpfunctions.com/ with htmlspecialchars(implode(" ",null)); it explode!
I think i'll add an if(null!=$e->ReleaseNotes){
...all the update of the field
}

@bkraul
Copy link
Author

bkraul commented Jun 5, 2019

Sounds good, but as I said, I don't think that is the main problem. Because even after putting in the release notes field, the push operation still fails with:

Got error 'PHP message: PHP Notice:  Undefined index: sizeBytes in /app/src/inc/commons/uploadutils.php on line 55\nPHP message: PHP Notice:  Trying to get property of non-object in /app/src/inc/nugetreader.php on line 192\n'

@bkraul
Copy link
Author

bkraul commented Jun 5, 2019

I can tell that the problem started with the wave of commits after (42cd592). (the ones with #71 Resolved chocolatey special api with Packages), because I just checked out that one commit and pushing works perfectly. So, not sure what's going on there, there are like 5 commits regarding the special API).

@bkraul
Copy link
Author

bkraul commented Jun 5, 2019

I can confirm commit 5f86b49 is what is breaking the push uploads. I am not sure which specific one of the changes in the commit does, but all the commits before that one work fine.

@bkraul
Copy link
Author

bkraul commented Jun 5, 2019

@kendarorg Quick question. I notice that this commit introduces an IsLatestVersion field to the database. Am I missing a schema upgrade, and could this be the problem (I have mySQL backend)? And if so, how do I apply it to my existing installation?

UPDATE: Nevermind, the field exists in my nugetdb_pkg table.

kendarorg added a commit that referenced this issue Jun 6, 2019
@kendarorg
Copy link
Owner

Added package \nuget_exes\NoRelease.1.0.0 to test

@bkraul
Copy link
Author

bkraul commented Jun 9, 2019

This is still not resolved. Still getting the error:

Got error 'PHP message: PHP Notice:  Undefined index: sizeBytes in /app/src/inc/commons/uploadutils.php on line 56
PHP message: PHP Notice:  Trying to get property of non-object in /app/src/inc/nugetreader.php on line 192

@kendarorg
Copy link
Owner

kendarorg commented Jun 10, 2019

I recognized now that you are treating Symbols packages!!

@kendarorg kendarorg reopened this Jun 10, 2019
@bkraul
Copy link
Author

bkraul commented Jun 10, 2019

The size is 199KB. The max is 50MB. And yes, I do both (with symbols and without symbols). As mentioned, this worked fine until after commit 5f86b49 .

@kendarorg kendarorg added the bug label Jun 10, 2019
@kendarorg kendarorg self-assigned this Jun 10, 2019
@kendarorg
Copy link
Owner

Tried to reduce the variations... (sorry for the dumb questions, but i am really trying to understand this thing)

kendarorg added a commit that referenced this issue Jun 10, 2019
kendarorg added a commit that referenced this issue Jun 10, 2019
@kendarorg
Copy link
Owner

if u can give it a try!

@bkraul
Copy link
Author

bkraul commented Jun 10, 2019

I did. Command returns:

C:\Users\bkraul\source\repos\WinForms\EPG.CommonLibrary\EPG.CommonLibrary\.nuget>.\nuget.exe push .\packages\*.symbols.nupkg [key] -source http://nuget.epginsurance.com/upload
Pushing EPG.CommonLibrary.1.1.21.7096.symbols.nupkg to 'http://nuget.epginsurance.com/upload'...
  PUT http://nuget.epginsurance.com/upload/
  InternalServerError http://nuget.epginsurance.com/upload/ 4778ms
  PUT http://nuget.epginsurance.com/upload/
  InternalServerError http://nuget.epginsurance.com/upload/ 1708ms
  PUT http://nuget.epginsurance.com/upload/
  InternalServerError http://nuget.epginsurance.com/upload/ 1413ms
Response status code does not indicate success: 500 (Missing Id and/or Version).
C:\Users\bkraul\source\repos\WinForms\EPG.CommonLibrary\EPG.CommonLibrary\.nuget>

PHP returns:

AH01071: Got error 'PHP message: PHP Notice:  Trying to get property of non-object in /app/src/inc/nugetreader.php on line 196

kendarorg added a commit that referenced this issue Jun 11, 2019
@adrift42
Copy link

adrift42 commented Mar 30, 2020

I was having a similar error with this, then upgraded to phpnuget 4.1.0.0 with php7.4.3:

[Mon Mar 30 15:23:44.967523 2020] [php7:error] [pid xxxx] [client xx.xx.xx.xx:61630] PHP Fatal error: Uncaught Error: Call to undefined function zip_open() in /srv/www/choco.domain/src/inc/commons/zipmanager.php:42\nStack trace:\n#0 /srv/www/choco.domain/src/inc/nugetreader.php(126): ZipManager->GenerateInfos()\n#1 /srv/www/choco.domain/src/uploadnupkg.php(67): NugetManager->LoadNuspecFromFile('/srv/www/choco....')\n#2 {main}\n thrown in /srv/www/choco.domain/src/inc/commons/zipmanager.php on line 42, referer: http://choco.domain/

@mostlydev
Copy link

@adrift42 You just need to install php-zip package, and php-curl while you're at it -- and php-mysql if you're using that.

But uploads are still broken.

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

No branches or pull requests

4 participants