Informatics journal: Hints, Errors detected, Problems avoided

30.12.24 tar create to stdout

tar -c xyz.* fails with tar: Refusing to write archive contents to terminal (missing -f option?), however
tar -c xyz.* | cat works: piping is ok

29.12.24 rclone google drive mount / filesize

rclone mount shows google docs with size 0. Affected are not only google docs but also google sheets (and probably other types in an internal google format) - the unknown filesize is only a symptom of a deeper problem. Although mount reports those files with the corresponding office-file-extension, they are of in the google internal format (after all, this is a mount, not sync!). If you double click such a file, your installed office (Writer, rsp. Word ...) tries to open it and fails - because it is not in office but in google format. Only when you copy/paste the file it will be converted to the corresponding office-format and you can work locally with it.

Thus a rdiff-backup to a rclone mount will not work properly, a two step process is necessary,first a rclone sync, and from there a rdiff-backup

https://forum.rclone.org/t/google-drive-mount-filesize/49271

26.12.24 PHP operator precedence: = binds stronger than and

thus, $a = $b and $c means ( $a = $b ) and $c, which is not always what you want... The alternative && binds stronger.

26.12.24 NextCloud DAV: a SEARCH for a bad fileid gives HTTP/1.1 500 Internal Server Error

https://github.com/nextcloud/server/issues/49972

13.12.24 NextCloud, Webdav. d:creationdate and nc:creation_time are always 0.

This is also true in the internal datastore nextcloud/USER/files/... or RCLONE mount.

  • RCLONE sync sets creation dates, but they are the timestamp from RCLONE, when it creates the file during the sync process. Is neiter taken from the properties (even if defined) nor the versions nor activity and are absolutely not the creation of the originally uploaded file.
  • modification / creation timestamp can be set in the put request by the special headers X-OC-MTime and X-OC-CTime
  • modification time is in the file attribute in the internal datastore nextcloud/USER/files/..., but creation time is not set to the fileattribute only visible in propFind
  • in the web interface, a file upload or creation only set modTst, but creTst remains 0
  • proppatch can change
    • <d:prop><nc:creation_time>" . strtotime('2023-12-29T06:17:59') . "</nc:creation_time></d:prop>"
    • but d:getlastmodified></d:prop>" # ==> HTTP/1.1 403 Forbidden
  • proppatch returns a multistatus, but only one Status is reported. Reported is the last prop, even if a prop before gets an error - and even if the status is ok, that does not mean, that the property has been updated as wished.

5.12.24 Google Auth2 Refresh_Token refreshing accesstoken

  • HTTP (POST to https://oauth2.googleapis.com/token which you find in the client json)
  • POST must be in uppercase !!!???!!!
  • the response does not contain the refresh_token, you must copy it from the old accessToken.
  • futhermore 'created' => unixtimestamp is missing, so, if you need it, you have to add it
  • the problem does not occurr with the apiLib, but also there the refresh_token does not change

5.12.24 Google Auth2 Refresh_Token. If you create a new access token using redirect uri to google oauth2 consent screen

  • php $client->setAccessType('offline') or http &access_type=offline yield a refresh_token
    • only the first time (or after a https://myaccount.google.com/u/0/permissions ⇒ select app/client ⇒ see details ⇒ Remove All Access
    • in the following requests, a shortened consent dialogue is give but noch refresh token generated (sent to the callback)
  • to get the refresh token (and the longer consent dialogue), additionally to offline use
    • php $client->setPrompt('consent'); or http &prompt=consent
  • attention: some blogs recommend &approval_prompt=forceed - this didn't work for me
  • the documentation ↗ was not helpfull to solve the issue