nextcloud / survey_client

🙋 Survey app which collects anonymized instance data to improve Nextcloud
GNU Affero General Public License v3.0
11 stars 14 forks source link

Sending usage report fails #29

Closed Gummikavalier closed 6 years ago

Gummikavalier commented 8 years ago
### Steps to reproduce 1. Go to Admin page -> Usage Report as Nextcloud administrator 2. Push 'Send new report now' button ### Expected behaviour Successfully send a report ### Actual behaviour You see an error message "An error occurred while sending your report." Nextcloud.log using debug level doesn't show any errors relating to email. Note: Sending usage report works on vanilla installation on Ubuntu. ### Server configuration **Operating system**: CentOS 7 **Web server:** Httpd 2.4.6 **Database:** MariaDB 5.5 **PHP version:** PHP 5.6 **Nextcloud version:** Nextcloud 10.0.0 **Updated from an older Nextcloud/ownCloud or fresh install:** Late history: Nextcloud 10.0.0 Nextcloud 9.0.53 Nextcloud 9.0.52 Nextcloud 9.0.50 ownCloud 9.0.2 **Where did you install Nextcloud from:** https://download.nextcloud.com/server/releases/nextcloud-10.0.0.zip **Signing status:**
Signing status _Results_ - core - INVALID_HASH - core/templates/login.php _Raw output_ Array ( [core] => Array ( [INVALID_HASH] => Array ( [core/templates/login.php] => Array ( [expected] => 95208884083d9adeb6bf120b5e7a28905a259a1e3a6d59efcb7ddbaaa8aef6210ca548de27d44e127f81a76338a52f5584d962b932629659329227fcac918b9d [current] => a4818175c131ff5ce502754895e2d9a745a452ab2eebebf508a4050e2beb0536b83df8141219b603132f3659412835bfc4f0ca7d72a3216fa8ff271e83e80f98 ) ``` ) ) ``` )
Comment: Changes to login.php are only to change password field string from "Password" -> "External password" to tip our users which password to use with the service. **List of activated apps:**
App list Enabled: - activity: 2.3.2 - admin_audit: 1.0.0 - calendar: 1.3.3 - comments: 1.0.0 - contacts: 1.4.0.0 - dav: 1.0.0 - federatedfilesharing: 1.0.1 - federation: 1.0.1 - files: 1.5.2 - files_external: 1.0.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 - notes: 2.0.2 - notifications: 0.3.0 - password_policy: 1.0.0 - serverinfo: 1.1.1 - spreedme: 0.3.1 - survey_client: 0.1.5 - systemtags: 1.0.2 - templateeditor: 0.1 - theming: 1.0.1 - user_ldap: 1.0.1 - workflowengine: 1.0.1
**The content of config/config.php:**
Config report 'obfuscated', 'passwordsalt' => 'obfuscated', 'secret' => 'obfuscated', 'datadirectory' => '/data/owncloud_data', 'dbtype' => 'mysql', 'version' => '9.1.0.16', 'dbname' => 'owncloud', 'dbhost' => '127.0.0.1', 'dbtableprefix' => 'oc_', 'dbuser' => 'obfuscated', 'dbpassword' => 'obfuscated', 'overwrite.cli.url' => 'https://kannu.csc.fi', 'installed' => true, 'ldapIgnoreNamingRules' => false, 'ldapUserCleanupInterval' => 1440, 'loglevel' => 0, 'logtimezone' => 'Europe/Helsinki', 'mail_smtpmode' => 'smtp', 'mail_smtphost' => 'argus.csc.fi', 'mail_smtpauth' => false, 'mail_domain' => 'csc.fi', 'theme' => 'csc', 'maintenance' => false, 'trusted_domains' => array ( 0 => 'kannu.csc.fi', 1 => 'kannu2.csc.fi', ), 'share_folder' => '/share', 'trashbin_retention_obligation' => 'auto', 'memcache.local' => '\OC\Memcache\APCu', 'updatechecker' => false, 'htaccess.RewriteBase' => '/', 'ldapProviderFactory' => '\OCA\User_LDAP\LDAPProviderFactory', 'auth.bruteforce.protection.enabled' => true, );
**Are you using external storage, if yes which one:** No **Are you using encryption:** No **Are you using an external user-backend, if yes which one:** ActiveDirectory #### LDAP configuration (delete this part if not used)
LDAP config Edited by hand to obfuscate names and huge list of groups. +--------------------------------------- | Configuration | s01 | +-------------------------------+------- | hasMemberOfFilterSupport | 1 | | hasPagedResultSupport | | | homeFolderNamingRule | attr:sAMAccountName | | lastJpegPhotoLookup | 0 | | ldapAgentName | CN=account,OU=accounts,OU=pathto,DC=domain,dc=example,dc=com | | ldapAgentPassword | **\* | | ldapAttributesForGroupSearch | | | ldapAttributesForUserSearch | | | ldapBackupHost | | | ldapBackupPort | 636 | | ldapBase | DC=domain,dc=example,dc=com | | ldapBaseGroups | OU=groups,DC=domain,dc=example,dc=com | | ldapBaseUsers | OU=users,DC=domain,dc=example,dc=com | | ldapCacheTTL | 1399 | | ldapConfigurationActive | 1 | | ldapDynamicGroupMemberURL | | | ldapEmailAttribute | mail | | ldapExperiencedAdmin | 0 | | ldapExpertUUIDGroupAttr | | | ldapExpertUUIDUserAttr | | | ldapExpertUsernameAttr | sAMAccountName | | ldapGroupDisplayName | cn | | ldapGroupFilter | (&(|(objectclass=group))(|(cn=group1)(cn=group2))) | | ldapGroupFilterGroups | group2 | | ldapGroupFilterMode | 1 | | ldapGroupFilterObjectclass | group | | ldapGroupMemberAssocAttr | member | | ldapHost | ldaps://dc1.domain.example.com | | ldapIgnoreNamingRules | | | ldapLoginFilter | (&(&(|(objectclass=person))(|(memberof=CN=group2,OU=groups,DC=domain,dc=example,dc=com)))(samaccountname=%uid)) | | ldapLoginFilterAttributes | | | ldapLoginFilterEmail | 0 | | ldapLoginFilterMode | 1 | | ldapLoginFilterUsername | 1 | | ldapNestedGroups | 0 | | ldapOverrideMainServer | 0 | | ldapPagingSize | 500 | | ldapPort | 636 | | ldapQuotaAttribute | | | ldapQuotaDefault | | | ldapTLS | | | ldapUserDisplayName | displayname | | ldapUserDisplayName2 | | | ldapUserFilter | (&(memberof=CN=group2,OU=groups,DC=domain,dc=example,dc=com)(!(userAccountControl:1.2.840.113556.1.4.803:=2))) | | ldapUserFilterGroups | group2 | | ldapUserFilterMode | 1 | | ldapUserFilterObjectclass | person | | ldapUuidGroupAttribute | auto | | ldapUuidUserAttribute | auto | | turnOffCertCheck | 0 | | useMemberOfToDetectMembership | 1 |
### Client configuration **Browser:** Firefox, Chrome **Operating system:** Linux, Windows ### Logs #### Web server error log No errors in httpd logs #### Nextcloud log (data/nextcloud.log) No errors (debug level enabled) #### Browser log If needed
nickvergessen commented 8 years ago

Did you install behind a proxy or change the URL between install and pressing the button? See https://help.nextcloud.com/t/my-experience-upgrading-to-nc10rc1/2444/12?u=nickvergessen

Gummikavalier commented 8 years ago

Thanks! I haven't changed the url but I have proxy set up locally for Spreed.ME. It only has the advised config for Spreed.ME:

<Location /webrtc>
ProxyPass http://127.0.0.1:8080/webrtc
ProxyPassReverse /webrtc
</Location>
<Location /webrtc/ws>
ProxyPass ws://127.0.0.1:8080/webrtc/ws
</Location>

SSLProxyEngine On
ProxyVia On
ProxyPreserveHost On
RequestHeader set X-Forwarded-Proto 'https' env=HTTPS

I tested now without the proxy config in place, but that didn't have effect.

I also tried cleaning up the notifications as in thread you mentioned and reinstalling 'Usage reports' app. I tried sending the report, but it failed again. It took couple of seconds until I got the error.

After that I checked select * from oc_notifications; there were no traces of 'survey_client', only announcements with 'announcementcenter' (which I have installed).

Gummikavalier commented 8 years ago

I can confirm that I'm not seeing this problem on two other CentOS based Nextcloud 10.0.0 installations. First one is CentOS 7 and second is CentOS 6. Neither of these installations are new, and have been ownClouds in their past (8.x). The one I'm having problems with goes all the way to ownCloud 4.x.x.

I was worried that if it was a CentOS based problem, it would have led to skewed statistics in the long run. That does not seem to be the case, at least. :)

Regarding the problem on this installation, I reversed the edit in login.php so that signing status check succeeded. That didn't help with the error though.

Gummikavalier commented 8 years ago

I removed all statistic options and suddenly the button worked fine. Then I selected the details one by one.

At first it seemed that the problem would be related to option: Number of shares (per type and permission setting) but sending reports with just that selection did not fail.

When I compare the output of report with 'Number of shares' enabled and disabled, the difference is 735 lines against 580 lines. Is there a size limit for the report?

Out of our four Nextcloud installations this is the biggest and most used one, so that would explain why the problem does not emerge on other installations.

nickvergessen commented 8 years ago

Can you provide us with your database information? which server and version are you using

Gummikavalier commented 8 years ago

Server:

# cat /etc/system-release
CentOS Linux release 7.2.1511 (Core) 

Database:

# rpm -qa | grep mariadb-server
mariadb-server-5.5.50-1.el7_2.x86_64
MariaDB [owncloud]> select version ();
+----------------+
| version ()     |
+----------------+
| 5.5.50-MariaDB |
+----------------+
1 row in set (0.00 sec)

Is there anything specific you want me to query from the database?

corsaved commented 8 years ago

Have a same problem. But have "An error occurred while sending your report." in all combinatio selected check-box. SMTP is configured correctly, because I get a test email. I get email notifications about Events, but can not send a letter about Server usage. I can send letter with shared link and password only after delete any informaton about Virtualhosts for Spreed.me and Collabora Online

All software is same (CentOS 7.2.1511 (core) , MariaDB, Nextcloud 10.0.1 (stable) )

dohlin commented 7 years ago

Any update on this issue or other thoughts? I'm seeing the exact same issue on my end as well.

My setup is an Ubuntu 16.04 server running Apache with a virtualhost that's set up to proxy request for a specific subdomain (i.e. example.example.com) to my server running a fresh install of Nextcloud 12.0.2 (utilizing Apache & MySQL). Everything else seems to work so far, but not this. Getting the exact same error with nothing in the Nextcloud log to show for it. The web console (Chrome) displays the following error:

Failed to load resource: the server responded with a status of 500 (Internal Server Error) /ocs/v2.php/apps/survey_client/api/v1//report?format=json

I can click the above link and it attempts to take me to https://example.example.com/ocs/v2.php/apps/survey_client/api/v1//report?format=json, but the page is completely blank...not even any errors in the console on that page.

One interesting item that might be of note is that I don't think it's related to the proxy server part of things...I could definitely be wrong, but if I got directly to the Nextcloud server and try to visit https://localhost/ocs/v2.php/apps/survey_client/api/v1//report?format=json (and thereby bypass the proxy entirely), I still get the same entirely blank page as noted above.

Have tried changing which boxes are checked on the submission page, running the 'select * from oc_notifications' (which found nothing), running the manual delete command from the bottom of the linked thread (https://help.nextcloud.com/t/my-experience-upgrading-to-nc10rc1/2444/12?u=nickvergessen), disabling and re-enabling the usage reports app (couldn't find a way to uninstall it fully), etc. No dice so far.

Here is the content of my main webserver apache virtual host config (the one doing the proxy'ing of requests):

   <IfModule mod_ssl.c>
    <VirtualHost *:443>

    ServerName example.example.com
      ServerAdmin webmaster@localhost

    Header set X-Frame-Options "SAMEORIGIN"

    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/example.example.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/example.example.com/privkey.pem

    SSLProxyEngine on
    SSLProxyVerify none
    SSLProxyCheckPeerName off
    SSLProxyCheckPeerCN off
    SSLProxyCheckPeerExpire off

    ProxyRequests Off
    ProxyPreserveHost On
    <Location />
            ProxyPass https://192.168.1.45/
            ProxyPassReverse https://192.168.1.45/
    </Location>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    </VirtualHost>

    </IfModule>

Here is the content of my Nextcloud server's apache virtual host config:


<VirtualHost *:443>

    DocumentRoot /var/www/nextcloud
    ServerAdmin webmaster@localhost

    SSLEngine on
    SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
    SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

    <Directory /var/www/nextcloud/>
        Options +FollowSymlinks
        AllowOverride All

        <IfModule mod_dav.c>
            Dav off
        </IfModule>

        SetEnv HOME /var/www/nextcloud
        SetEnv HTTP_HOME /var/www/nextcloud
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

And here is my Nextcloud config.php:


<?php
$CONFIG = array (
  'instanceid' => '[redacted]',
  'passwordsalt' => '[redacted]',
  'secret' => '[redacted]',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '192.168.1.45',
    2 => 'example.example.com',
  ),
  'datadirectory' => '/data',
  'overwrite.cli.url' => 'https://example.example.com',
  'dbtype' => 'mysql',
  'version' => '12.0.2.0',
  'dbname' => '[redacted]',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => '[redacted]',
  'dbpassword' => '[redacted]',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'updater.release.channel' => 'stable',
  'updater.secret' => '[redacted]',
  'loglevel' => '0',
  'logfile' => '/var/log/nextcloud.log',
  'logtimezone' => 'America/Chicago',
  'mail_smtpmode' => 'smtp',
  'appstore.experimental.enabled' => true,
  'mail_smtphost' => 'smtp.gmail.com',
  'mail_smtpsecure' => 'tls',
  'mail_smtpport' => '587',
  'mail_from_address' => '[redacted]',
  'mail_domain' => 'gmail.com',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpauth' => 1,
  'mail_smtpname' => '[redacted]',
  'mail_smtppassword' => '[redacted]',
  'maintenance' => false,
  'theme' => '',
);

Any suggestions on what to try next? I'd really like to be able to submit info to keep this wonderful project in tip top shape if possible! Thanks!

Rayn0r commented 7 years ago

I got the same problem here. I'm runninc NC 12.0.2 on an Ubuntu 16.04 with mysql-server-5.7 . When trying to send a survey, I see this in FFs Debug console: POST XHR https://example.example.test/nextcloud/ocs/v2.php/apps/survey_client/api/v1//report?format=json [HTTP/1.1 200 Connection established 5483ms]

The second time I click the "Send new report now" button I get this error: POST XHR https://example.example.test/nextcloud/ocs/v2.php/apps/survey_client/api/v1//report?format=json [HTTP/1.1 500 Internal Server Error 5214ms]

Unfortunately the Apache2 error log does not provide more information: x.x.x.x - - [17/Aug/2017:09:50:56 +0200] "POST /nextcloud/ocs/v2.php/apps/survey_client/api/v1//report?format=json HTTP/1.1" 500 4448 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0"

How can this be debugged? Could the json file contain illegal chars? Could this be related to the DB Setup? I'm using the standard Ubuntu mysqld.cnf with the following additional parameter:

key_buffer_size     = 256M
max_allowed_packet  = 16M
thread_stack        = 192K
thread_cache_size       = 8

table_open_cache = 1024
sort_buffer_size = 2M
join_buffer_size = 16M
interactive_timeout = 14400
innodb_buffer_pool_size = 512M
innodb_buffer_pool_instances = 1
innodb_log_files_in_group = 2
innodb_log_file_size=64M
tmp_table_size = 256M
max_heap_table_size = 256M
innodb_file_per_table = 1
skip-name-resolve = 1
innodb_thread_concurrency = 0

This is my config.php:

<?php
$CONFIG = array (
  'instanceid' => 'XXX',
  'passwordsalt' => 'XXX',
  'secret' => 'XXX',
  'trusted_domains' =>
  array (
    0 => 'example.example.test',
    1 => '192.168.3.43',
    2 => 'server',
  ),
  'datadirectory' => '/tank/nextcloud-data',
  'overwrite.cli.url' => 'https://example.example.test/nextcloud/',
  'dbtype' => 'mysql',
  'version' => '12.0.2.0',
  'dbname' => 'owncloud',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'oc_admin1',
  'dbpassword' => 'XXX',
  'installed' => true,
  'forcessl' => true,
  'forceSSLforSubdomains' => true,
  'tempdirectory' => '/var/lib/nextcloud',
  'theme' => '',
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => 'true',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
  'host' => 'localhost',
  'port' => 6379,
  'timeout' => 0.0,
    ),
  'loglevel' => 0,
  'mail_from_address' => 'webmaster',
  'mail_smtpmode' => 'smtp'
  'mail_domain' => 'example.example.test',
  'singleuser' => false,
  'updater.release.channel' => 'production',
  'mail_smtphost' => 'localhost',
  'mail_smtpport' => '25',
  'updater.secret' => 'XXX',
);
nickvergessen commented 7 years ago

Should be fixed now

dohlin commented 7 years ago

And like that, mine is magically back to working. Thank you!!

Rayn0r commented 7 years ago

It is working now. Thanks a lot.

creopard commented 6 years ago

I'm still facing the same issues, Rayn0r reported back on 17 Aug. Is this feature broken again with NC 12.0.4.3?

dohlin commented 6 years ago

I can confirm that I'm also seeing the issue once again, but still on NC 12.0.3 (have NOT yet updated to 12.0.4). I just tested it and got the generic "An error occurred while sending your report." error message at the top of the screen.

I think this is one of those things that I don't notice when it's working or when it's broke unless I manually test it - it doesn't produce any obvious errors unless you actually go in and try to manually send a new report.

Gummikavalier commented 6 years ago

Yes, all four Nextcloud instances I maintain fail to send report now with 12.0.4. Looking at the Usage survey page it was still working in 21th of November, so it was ok on 12.0.3 for me.

(Running Nextcloud on PHP 7.0 and MariaDB 10.1 these days.)

HappyZ commented 6 years ago

I have the same problem on 12.0.4

vitobotta commented 6 years ago

Me too on 12.0.4

nickvergessen commented 6 years ago

Should be fixed with https://github.com/nextcloud/survey_server/pull/22

MorrisJobke commented 6 years ago

Should work again 👍

HappyZ commented 6 years ago

It works confirmed.

Gummikavalier commented 6 years ago

Works in 12.0.5. 👍

Only my original problem with one of our earliest Nextcloud systems still stands. Our server cannot send the report if I have shares selected in the survey page. The reason may be the amount of shares since this installation has been in use for a very long time (select * from oc_share listed 1827 rows). This system has been already moved to MariaDB 10.1 and PHP 7.0 but this did not help, nor did raising php memory limits in case that the list is too long to handle.

It is not a big issue so this may be kept closed for now. If someone encounters the same problem, just reopen or refer to this again.

ktuulos commented 5 years ago

I have four installations running 15.08, all are on Ubuntu 16.04. All installations were installed using the web installer method. The survey button does not work in any of those, it has never worked.