Skip to content

Conversation

@szaimen
Copy link
Contributor

@szaimen szaimen commented Nov 1, 2022

Close #34674

Signed-off-by: szaimen szaimen@e.mail.de

Signed-off-by: szaimen <szaimen@e.mail.de>
@szaimen szaimen added the 3. to review Waiting for reviews label Nov 1, 2022
@szaimen szaimen added this to the Nextcloud 25.0.2 milestone Nov 1, 2022
@szaimen szaimen requested review from a team, CarlSchwan, blizzz and icewind1991 and removed request for a team November 1, 2022 12:45
@szaimen szaimen mentioned this pull request Nov 1, 2022
@szaimen szaimen requested review from artonge and skjnldsv November 2, 2022 10:12
@szaimen szaimen merged commit d6eaaf3 into stable25 Nov 3, 2022
@szaimen szaimen deleted the enh/34674/stable25 branch November 3, 2022 11:56
@sunjam
Copy link

sunjam commented Nov 3, 2022

Does this mean 32-bit is still supported @szaimen ?

@szaimen
Copy link
Contributor Author

szaimen commented Nov 3, 2022

Does this mean 32-bit is still supported @szaimen ?

Only for 25. NC26 has the compatibility officially removed.

@szaimen
Copy link
Contributor Author

szaimen commented Nov 3, 2022

@sunjam
Copy link

sunjam commented Nov 3, 2022

@szaimen Thank you, I've seen it. I want to know if this fix means 32-bit support is now available in nc25 or not.

@szaimen
Copy link
Contributor Author

szaimen commented Nov 3, 2022

The fix will be available in 25.0.2

@lapineige
Copy link

lapineige commented Dec 10, 2022

Problem still here after an upgrade from 25.0.1.
It's even worse: Internal Server Error, and no longer access to any app (instead of Files app not working alone)

From the log file:

"File":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Quota.php","Line":68,"message":"Cannot assign float to property OC\Files\Storage\Wrapper\Quota::$quota of type ?int","exception":{},"CustomMessage":"Cannot assign float to property OC\Files\Storage\Wrapper\Quota::$quota of type ?int"

@lapineige
Copy link

lapineige commented Dec 10, 2022

Fixed by changing the Quota.
It was 50GB.

sudo -u nextcloud phpVERSIONnumber occ user:setting accountName files quota 50000000 did fix it… but with a 50MB quota. Anything above (5GB, 5MB…) does not work.
In fact a quota with "GB" inside and not a number trigger the bug. Anything above ~2GB does too.

@userloris
Copy link

@lapineige I got the same error after the upgrade to NC 25.0.2. I solved replacing "int" with "float" into the file Quota.php, as following
diff /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Quota.php /var/www/nextcloud/lib/private/Files/Storage/Wrapper/Quota.php.bak
44c44
< protected ?float $quota;

  protected ?int $quota;

62c62
< public function getQuota(): float {

  public function getQuota(): int {

104c104
< * @return float|bool

   * @return int|bool

131c131
< * @return float|false

   * @return int|false

@lapineige
Copy link

The formatting is broken but I managed to find those lines.
The quota is now working, a 5GB quota is clearly displayed as such.

Thanks a lot ! 🎉

@j-be
Copy link

j-be commented Dec 16, 2022

Just for completeness, as already mentioned in #34674 I managed to get a quick and dirty 32 Bit CI running at https://github.com/j-be/nextcloud-ci and even though there are definitely false positives in there, there is also a very distinct hint to the Quota thingy reported above as:

7) Test\User\UserTest::testSetQuota
Expectation failed for method name is "setUserValue" when invoked 1 time(s)
Parameter 3 for invocation OCP\IConfig::setUserValue('foo', 'files', 'quota', '0 B', null) does not match expected value.
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@

-'23 TB'
+'0 B'

There are 11 more issues in total I get on i386, but not on AMD64 (and there are 6 I get on both, so omitted) in nextcloud_i386_ci.log. Just in case someone wants to have a look at it.

@come-nc
Copy link
Contributor

come-nc commented Dec 19, 2022

@j-be Could you run that CI on #35734 and tell me if it fixes quota errors on 32bits?

MichaIng added a commit that referenced this pull request Dec 20, 2022
Resolves the issue reported here: #34905 (comment)

Signed-off-by: MichaIng <micha@dietpi.com>
@MichaIng
Copy link
Member

PR up to fix 32-bit support for NC25 with quota enabled: #35832

@lapineige
Copy link

Replaced by #35734

@j-be
Copy link

j-be commented Jan 6, 2023

@come-nc Sorry for the delay, christmas and stuff.

I ran the CI against stable25 branch:

  • AMD64: 6 failures, 5 of which with share links. Not sure what is wrong. Log attached as stable25_amd64.log
  • i386 16 failures, including Test\User\UserTest::testSetQuota and all 6 of AMD64. Log attached as stable25_i386.log

But what I didn't notice previously: There are some "errors" in i386 which apparently do NOT cause test failures:

8) Test\MemoryInfoTest::testMemoryLimit with data set "2G" ('2G', 2147483648.0)
TypeError: Argument 2 passed to Test\MemoryInfoTest::testMemoryLimit() must be of the type int, float given, called in /usr/share/php/PHPUnit/Framework/TestCase.php on line 1526

/server/tests/lib/MemoryInfoTest.php:77

[ ... ]

24) OCA\Files_Trashbin\Tests\BackgroundJob\ExpireTrashTest::testConstructAndRun
PHPUnit\Framework\MockObject\IncompatibleReturnValueException: Method getTime may not return value of type double, its return declaration is "int"

/server/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php:64

25) OCA\Files_Trashbin\Tests\BackgroundJob\ExpireTrashTest::testBackgroundJobDeactivated
PHPUnit\Framework\MockObject\IncompatibleReturnValueException: Method getTime may not return value of type double, its return declaration is "int"

/server/apps/files_trashbin/tests/BackgroundJob/ExpireTrashTest.php:64

26) OCA\Files_Versions\Tests\BackgroundJob\ExpireVersionsTest::testBackgroundJobDeactivated
PHPUnit\Framework\MockObject\IncompatibleReturnValueException: Method getTime may not return value of type double, its return declaration is "int"

/server/apps/files_versions/tests/BackgroundJob/ExpireVersionsTest.php:73

27) OCA\Provisioning_API\Tests\Controller\UsersControllerTest::testAddUserSuccessfulGenerateUserID
rand() expects parameter 2 to be int, float given

/server/apps/provisioning_api/tests/Controller/UsersControllerTest.php:500
/server/apps/provisioning_api/lib/Controller/UsersController.php:309
/server/apps/provisioning_api/lib/Controller/UsersController.php:348
/server/apps/provisioning_api/tests/Controller/UsersControllerTest.php:505

If you want to run the CI yourself: Just clone https://github.com/j-be/nextcloud-ci/ and assuming you have Docker up and running anyway do docker build --platform=i386 --build-arg NEXTCLOUD_VERSION=stable25 ..

If you want to do anything else with it: feel free, it is MIT licensed on purpose.

I'll see if I can somehow upload the reports to gh-pages.

@j-be
Copy link

j-be commented Jan 6, 2023

I managed to upload the reports to GitHub pages, see https://j-be.github.io/nextcloud-ci/

When accessing, please keep in mind, that gh-pages does heavy caching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

10 participants