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

[Bug]: scan-app-data conversion #34283

Closed
6 of 9 tasks
bwmravec opened this issue Sep 27, 2022 · 11 comments · Fixed by #35935
Closed
6 of 9 tasks

[Bug]: scan-app-data conversion #34283

bwmravec opened this issue Sep 27, 2022 · 11 comments · Fixed by #35935
Assignees
Labels
4. to release Ready to be released and/or waiting for tests to finish bug needs info

Comments

@bwmravec
Copy link

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

After running occ files:scan-app-data on server v24.0.5, I'm getting

In ScanAppData.php line 242:
Implicit conversion from float 0.4666666666666667 to int loses precision

Steps to reproduce

  1. Install nextcloud
  2. run occ files:scan-app-data
  3. get error message

Expected behavior

Not getting error message

Installation method

Community Manual installation with Archive

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.1

Web server

Nginx

Database engine version

MariaDB

Is this bug present after an update or on a fresh install?

Updated to a major version (ex. 22.2.3 to 23.0.1)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

No response

List of activated Apps

Enabled:
  - accessibility: 1.10.0
  - activity: 2.16.0
  - admin_audit: 1.14.0
  - bruteforcesettings: 2.4.0
  - cloud_federation_api: 1.7.0
  - comments: 1.14.0
  - dav: 1.22.0
  - federatedfilesharing: 1.14.0
  - files: 1.19.0
  - files_downloadactivity: 1.13.0
  - files_sharing: 1.16.2
  - files_trashbin: 1.14.0
  - lookup_server_connector: 1.12.0
  - provisioning_api: 1.14.0
  - serverinfo: 1.14.0
  - settings: 1.6.0
  - theming: 1.15.0
  - viewer: 1.8.0
  - workflowengine: 2.6.0

Nextcloud Signing status

No response

Nextcloud Logs

No response

Additional info

No response

@bwmravec bwmravec added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Sep 27, 2022
@szaimen
Copy link
Contributor

szaimen commented Sep 27, 2022

Hi, is this instance running with 64bit PHP?
Can you show a screenshot of the serverinfo app?

@Hiyoal
Copy link

Hiyoal commented Oct 23, 2022

I managed to find a fix due to the deprecation with php 8+.

I don't know how to use Github properly so I'll post my fix here. Hopefully someone who's more skilled than me can pull this.

File in question:
https://github.com/nextcloud/server/blob/master/apps/files/lib/Command/ScanAppData.php

Line 242:
Currently -
return sprintf('%02d:%02d:%02d', ($secs / 3600), ($secs / 60 % 60), $secs % 60);

Changed to-
return sprintf('%02d:%02d:%02d', intdiv($secs, 3600), intdiv($secs, 60) % 60, $secs % 60);

occ files:scan-app-data works after this change is made.

@solracsf
Copy link
Member

solracsf commented Nov 8, 2022

@Hiyoal mind to make a PR to review? Thanks.

mgoeppl added a commit to mgoeppl/server that referenced this issue Nov 8, 2022
Fixes nextcloud#34283

Signed-off-by: Moritz Göppl <24495490+mgoeppl@users.noreply.github.com>
@Cebrain
Copy link

Cebrain commented Nov 9, 2022

I also have this problem in v25.0.1 not every time i run the scan but often.

@szaimen szaimen added 2. developing Work in progress and removed needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Nov 9, 2022
@Bockeman
Copy link

Bockeman commented Dec 7, 2022

I have also seen this problem on two recent NC updates:

NC 25.0.0

sudo -u apache php /var/www/html/nextcloud/console.php files:scan-app-data
  Scanning AppData for files
  In ScanAppData.php line 242:                                                               
    Implicit conversion from float 3.5 to int loses precision  
  files:scan-app-data [--output [OUTPUT]] [--] [<folder>]

NC 25.0.2 RC3

sudo -u apache php /var/www/html/nextcloud/console.php files:scan-app-data
  Scanning AppData for files
  In ScanAppData.php line 242:                                                               
    Implicit conversion from float 2.783333333333333 to int loses precision  
  files:scan-app-data [--output [OUTPUT]] [--] [<folder>]

PHP is 64-bit

file /usr/bin/php
/usr/bin/php: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=89ac9777b046d0efb754ca46d060854b91033745, for GNU/Linux 3.2.0, stripped

@bahoop
Copy link

bahoop commented Dec 24, 2022

root@xxxx:/var/www/nc# sudo -u www-data php ./occ files:scan-app-data
Scanning AppData for files
In ScanAppData.php line 242:

  Implicit conversion from float 8.5 to int loses precision


files:scan-app-data [--output [OUTPUT]] [--] [<folder>]
PHP 8.1.13 (cli) (built: Nov 26 2022 14:07:36) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.13, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.13, Copyright (c), by Zend Technologies

Nextcloud Version is 25.0.2.

not sure how to check if php executable is 32/64 yet

EWouters added a commit to EWouters/server that referenced this issue Jan 1, 2023
Applies suggestion from @Hiyoal in nextcloud#34283.

See nextcloud#34283 (comment).

Closes nextcloud#34283.

Signed-off-by: EWouters <6179932+EWouters@users.noreply.github.com>
@st3iny st3iny assigned st3iny and unassigned st3iny Jan 2, 2023
@st3iny st3iny added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jan 2, 2023
@come-nc
Copy link
Contributor

come-nc commented Jan 2, 2023

@st3iny We can close this now, right?

@st3iny
Copy link
Member

st3iny commented Jan 2, 2023

@st3iny We can close this now, right?

Not yet. The command scan-app-data is still affected by the deprecation. Only scan was fixed.

EWouters added a commit to EWouters/server that referenced this issue Jan 3, 2023
Adapted from sugestions by @Hiyoal in nextcloud#34283 and @st3iny in nextcloud#35935.

See nextcloud#34283 (comment)
and nextcloud#35935 (comment).

Closes nextcloud#34283.

Co-authored-by: Richard Steinmetz <richard@steinmetz.cloud>
Signed-off-by: EWouters <6179932+EWouters@users.noreply.github.com>
@szaimen
Copy link
Contributor

szaimen commented Jan 23, 2023

Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!

My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!

If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 3. to review Waiting for reviews labels Jan 23, 2023
@st3iny
Copy link
Member

st3iny commented Jan 23, 2023

@szaimen The bug is fixed and pending for merge/release.

Someone please merge the PR at #35935.

@st3iny st3iny added 4. to release Ready to be released and/or waiting for tests to finish and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jan 23, 2023
@szaimen
Copy link
Contributor

szaimen commented Jan 23, 2023

Merged 👍

backportbot-nextcloud bot pushed a commit that referenced this issue Jan 23, 2023
Adapted from sugestions by @Hiyoal in #34283 and @st3iny in #35935.

See #34283 (comment)
and #35935 (comment).

Closes #34283.

Co-authored-by: Richard Steinmetz <richard@steinmetz.cloud>
Signed-off-by: EWouters <6179932+EWouters@users.noreply.github.com>
backportbot-nextcloud bot pushed a commit that referenced this issue Jan 24, 2023
Adapted from sugestions by @Hiyoal in #34283 and @st3iny in #35935.

See #34283 (comment)
and #35935 (comment).

Closes #34283.

Co-authored-by: Richard Steinmetz <richard@steinmetz.cloud>
Signed-off-by: EWouters <6179932+EWouters@users.noreply.github.com>
s8321414 pushed a commit to MODAODF/odfweb that referenced this issue May 4, 2023
Adapted from sugestions by @Hiyoal in #34283 and @st3iny in #35935.

See nextcloud/server#34283 (comment)
and nextcloud/server#35935 (comment).

Closes #34283.

Co-authored-by: Richard Steinmetz <richard@steinmetz.cloud>
Signed-off-by: EWouters <6179932+EWouters@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. to release Ready to be released and/or waiting for tests to finish bug needs info
Projects
None yet
9 participants