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

Log in image is not showing #2208

Closed
ace0024 opened this issue Nov 21, 2016 · 20 comments
Closed

Log in image is not showing #2208

ace0024 opened this issue Nov 21, 2016 · 20 comments

Comments

@ace0024
Copy link

ace0024 commented Nov 21, 2016

Steps to reproduce

  1. Log in with admin right
  2. go to Admin area -> themes
  3. upload any Background image - confirmation will appears "save"
  4. now log out or use another browser to check the login BG

Expected behaviour

i will see the uploaded BG image

Actual behaviour

i can only see the custom color which i can choose in the theming app as BG.
no uploaded BG image !

Server configuration

Operating system:
Ubuntu 14.04.5 LTS

Web server:
apache

Database:
mysql

PHP version:
PHP 5.5.9-1ubuntu4.20

Nextcloud version: (see Nextcloud admin page)
nc 10.0.1

Updated from an older Nextcloud/ownCloud or fresh install:
OC 8.2.5 (stable) -> nextcloud-9.0.54 -> nextcloud-10.0.1

Where did you install Nextcloud from:
https://download.nextcloud.com/server/releases/

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

**No errors have been found.**

</details>

**List of activated apps:**

Enabled:
  - activity: 2.3.2
  - admin_audit: 1.0.0
  - comments: 1.0.0
  - dav: 1.0.1
  - federatedfilesharing: 1.0.1
  - federation: 1.0.1
  - files: 1.5.2
  - files_pdfviewer: 0.8.1
  - files_sharing: 1.0.0
  - files_texteditor: 2.1
  - files_trashbin: 1.0.0
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 15.0.0
  - notifications: 0.3.0
  - password_policy: 1.0.0
  - provisioning_api: 1.0.0
  - serverinfo: 1.1.1
  - survey_client: 0.1.5
  - systemtags: 1.0.2
  - templateeditor: 0.1
  - theming: 1.0.1
  - updatenotification: 1.0.1
  - workflowengine: 1.0.1
Disabled:
  - encryption
  - external
  - files_accesscontrol
  - files_automatedtagging
  - files_external
  - files_retention
  - user_external
  - user_ldap
  - user_saml

</details>

**The content of config/config.php:**

<?php
$CONFIG = array (
  'instanceid' => 'oce9628a8b60',
  'trusted_domains' =>
  array (
    0 => 'xxx.xxx.xxx.xxx',
    1 => 'xxxx.xxxxx.de',
  ),
  'datadirectory' => '/data',
  'overwrite.cli.url' => 'https://xxxx.xxxxxx.de/owncloud',
  'dbtype' => 'mysql',
  'version' => '9.1.1.5',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'blubb',
  'logtimezone' => 'Europe/Berlin',
  'installed' => true,
  'preview_libreoffice_path' => '/usr/bin/libreoffice',
  'forcessl' => true,
  'forceSSLforSubdomains' => true,
  'loglevel' => 3,
  'log_type' => 'owncloud',
  'log_authfailip' => true,
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_smtphost' => 'xxxxxxx-de.mail.protection.outlook.com',
  'mail_smtpport' => '25',
  'mail_from_address' => 'info',
  'mail_domain' => 'xxxxx.de',
  'maintenance' => false,
  'trashbin_retention_obligation' => 'auto, 30',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => 'true',
  'theme' => '',
  'updater.secret' => '++++++++++++++++++++++++++++++++++++',
);


**Are you using external storage, if yes which one:** local/smb/sftp/...
no
**Are you using encryption:** no

**Are you using an external user-backend, if yes which one:** LDAP/ActiveDirectory/Webdav/...
no

### Client configuration
**Browser:**
safari, chrome, ff, ie

**Operating system:**
Win10, osx 10.11.6

### Logs
#### Web server error log

[Mon Nov 21 07:19:34.107347 2016] [ssl:error] [pid 4920] AH02032: Hostname xxxxx.de. provided via SNI and hostname  xxxx.de provided via HTTP are different
[Mon Nov 21 08:21:02.082843 2016] [:error] [pid 32425] [client xxxxx:55411] PHP Parse error:  imagescale(): one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n in /var/www/nextcloud/apps/theming/lib/Controller/ThemingController.php on line 211
[Mon Nov 21 08:23:23.315743 2016] [:error] [pid 549] [client xxxxx:55443] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 77 bytes) in /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 128
[Mon Nov 21 08:23:23.315597 2016] [:error] [pid 548] [client xxxxxxx:55451] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 82 bytes) in /var/www/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php on line 128

#### Nextcloud log (data/nextcloud.log)
Error	PHP	imagescale(): one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully at /var/www/nextcloud/apps/theming/lib/Controller/ThemingController.php#211	2016-11-21T08:21:02+01:00	ownadmin
Error	PHP	imagedestroy() expects parameter 1 to be resource, boolean given at /var/www/nextcloud/apps/theming/lib/Controller/ThemingController.php#215	2016-11-21T08:21:02+01:00	ownadmin
Error	PHP	imagejpeg() expects parameter 1 to be resource, boolean given at /var/www/nextcloud/apps/theming/lib/Controller/ThemingController.php#214	2016-11-21T08:21:02+01:00	ownadmin
Error	PHP	imageinterlace() expects parameter 1 to be resource, boolean given at /var/www/nextcloud/apps/theming/lib/Controller/ThemingController.php#213	2016-11-21T08:21:02+01:00	ownadmin


@MorrisJobke
Copy link
Member

Could you open the web developer tools in your browser and refresh the login page. Are there then any errors listed in the network or console tab of the web developer tools?

@ace0024
Copy link
Author

ace0024 commented Nov 21, 2016

no errors!

Network and console

screen shot 2016-11-21 at 10 04 02

@MorrisJobke
Copy link
Member

Then try the same on the theming page. Open those tools and then upload the image. Are there any errors then?

What image type are you uploading?

@ace0024
Copy link
Author

ace0024 commented Nov 21, 2016

jpg

no errors on theming page

@ace0024
Copy link
Author

ace0024 commented Nov 21, 2016

after some time
screen shot 2016-11-21 at 10 32 14

@MorrisJobke
Copy link
Member

When there is a error 500 there should be something in the nextcloud log. Could you check the nextcloud.log in the data dir and the webservers error log?

@ace0024
Copy link
Author

ace0024 commented Nov 21, 2016

apache.txt
nextcloud.txt

@MorrisJobke
Copy link
Member

This is the code (roughly):

$newBackgroundLogo = $this->request->getUploadedFile('upload-login-background');
$image = @imagecreatefromstring(file_get_contents($newBackgroundLogo['tmp_name'], 'r'));
if ($image === false) {
  return;
}
$image = imagescale($image, 1920);
imageinterlace($image, 1);
imagejpeg($image, $tmpFile, 75);
imagedestroy($image);

Weird thing is that the $image is not false but the only documented return value of imagecreatefromstring is false or a resource. Nevertheless shows the log following:

{
    "app": "PHP",
    "level": 3,
    "message": "imageinterlace() expects parameter 1 to be resource, boolean given at /var/www/nextcloud/apps/theming/lib/Controller/ThemingController.php#213",
    "method": "POST",
    "remoteAddr": "188.192.179.44",
    "reqId": "WC-xU4Z3Cu4AAA2-GqcAAAAF",
    "time": "2016-11-19T07:29:40+01:00",
    "url": "/index.php/apps/theming/ajax/updateLogo",
    "user": "ownadmin"
}
{
    "app": "PHP",
    "level": 3,
    "message": "imagejpeg() expects parameter 1 to be resource, boolean given at /var/www/nextcloud/apps/theming/lib/Controller/ThemingController.php#214",
    "method": "POST",
    "remoteAddr": "188.192.179.44",
    "reqId": "WC-xU4Z3Cu4AAA2-GqcAAAAF",
    "time": "2016-11-19T07:29:41+01:00",
    "url": "/index.php/apps/theming/ajax/updateLogo",
    "user": "ownadmin"
}
{
    "app": "PHP",
    "level": 3,
    "message": "imagedestroy() expects parameter 1 to be resource, boolean given at /var/www/nextcloud/apps/theming/lib/Controller/ThemingController.php#215",
    "method": "POST",
    "remoteAddr": "188.192.179.44",
    "reqId": "WC-xU4Z3Cu4AAA2-GqcAAAAF",
    "time": "2016-11-19T07:29:41+01:00",
    "url": "/index.php/apps/theming/ajax/updateLogo",
    "user": "ownadmin"
}
{
    "app": "PHP",
    "level": 3,
    "message": "imagescale(): one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n at /var/www/nextcloud/apps/theming/lib/Controller/ThemingController.php#211",
    "method": "POST",
    "remoteAddr": "188.192.179.44",
    "reqId": "WC-xU4Z3Cu4AAA2-GqcAAAAF",
    "time": "2016-11-19T07:29:41+01:00",
    "url": "/index.php/apps/theming/ajax/updateLogo",
    "user": "ownadmin"
}

Any idea @LukasReschke @icewind1991 @juliushaertl ?

@juliushaertl
Copy link
Member

@MorrisJobke No idea why this is failing.

@ace0024 Is this only happening with one specific file or with all JPEGs in your setup?

@ace0024
Copy link
Author

ace0024 commented Nov 22, 2016

i tried a few jpegs and png... all the same problem

@juliushaertl
Copy link
Member

juliushaertl commented Nov 22, 2016

Ah there was this report on the forum already: https://help.nextcloud.com/t/theming-no-log-in-image-possible-nc10-01-ubuntu-14-04-php5/3873/2

So this could be an issue with the PHP version: https://bugs.php.net/bug.php?id=65171

PHP documentation on imagescale: http://php.net/manual/en/function.imagescale.php

Caution
You should always provide the height if using PHP 5.5.18 or earlier, or PHP 5.6.2 or earlier, as the aspect ratio calculation was incorrect.

So my guess is this but is not fixed in your php version PHP 5.5.9-1ubuntu4.20.

@MorrisJobke
Copy link
Member

So my guess is this but is not fixed in your php version PHP 5.5.9-1ubuntu4.20

Could we add a workaround for these PHP versions?

@juliushaertl
Copy link
Member

@MorrisJobke Calculating the new height for keeping the aspect ratio and passing it to the imagescale function should be enough i think.

@juliushaertl juliushaertl self-assigned this Nov 22, 2016
@juliushaertl
Copy link
Member

@MorrisJobke I'll try to reproduce and add a workaround.

@juliushaertl
Copy link
Member

Workaround is in #2232

@ace0024 Would be great if you could test if this fixes the issue for you.

@ace0024
Copy link
Author

ace0024 commented Nov 22, 2016

okay thx... wait..

@ace0024
Copy link
Author

ace0024 commented Nov 22, 2016

now it works ! cool thank you
screen shot 2016-11-22 at 12 28 56

Do I have to consider anything for further updates?

@juliushaertl
Copy link
Member

Once approved in #2232 this will be merged to master and backported to stable10 so there should be nothing to worry about in the future.

@ace0024
Copy link
Author

ace0024 commented Nov 22, 2016

perfect! Thank you for the grateful support! 👍

@MorrisJobke
Copy link
Member

Thanks a lot @juliushaertl 👍

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

No branches or pull requests

3 participants