-
Notifications
You must be signed in to change notification settings - Fork 135
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
Issue Creating New Notes when using Object Storage #326
Comments
Thanks for reporting this issue. Unfortunately, I can't reproduce this and I can't see anything in the log which could help to create a fix. Does anybody else have this problem, too? |
Okay, thanks for taking a look! Figured I would leave this open a bit to see if anyone else had seen this issue. Seeing as there were no takers, I am going to close it. |
I actually have the same issue on a fresh NC 16 install. After clicking on "New Note" an error is shown, but the note is created after refreshing the page.
|
@severinkaderli Out of curiosity, are you using some S3 provider as your primary storage? I am doing so and I am wondering if perhaps there could be some kind of bad reaction there. It is just strange since, as you said, the notes do show up after a page refresh. I do not have any issues creating files in the Notes folder using the Files app or the Notes Android app... |
@jkuester Yes I do. I use DigitalOcean Spaces as primary storage. |
That's interesting, maybe we are going nearer to the source of the problem. @jkuester Do you use DigitalOcean Spaces, too?
|
@korelstar I'm on the same instance as @severinkaderli. |
@korelstar Yes! I am also using DigitalOcean Spaces. Also, my behavior matches @martyschaer. The error happens every time I create a new note and the new note file is empty (not even a single space). Not sure if it matters or not, but I also noticed that the note is created when the "New note" button is pressed, but it just does not show up in the Notes app until the page is refreshed. If I press the "New note" button and then switch to the Files app without reloading the Notes app, I can see the newly created note file in my Notes folder. Also, in the Notes app if I press the "New note" button multiple times without reloading the page, I get the same error each time. Then when I reload the page there is a new note for each time that I pressed the button. |
I am using OVH Public Cloud OpenStack Swift as Primary Storage and I am getting the same error. On Nextcloud 15.0.10 |
Is there a S3 provider with a free plan / trial period on which this issue occurs? This would be helpful for me to find a fix. |
I don't think so, unfortunately, I am not the one with the funds to provide you with an OpenStack Swift endpoint here. You can try setting up devstack: https://docs.openstack.org/devstack/latest/ |
I think using a DigitalOcean referral code will give you $50 credit for a month, if that's an option for you? |
Another possibility might be Minio, a self-hosted object storage. |
I'm not sure the bug affects S3 or just OpenStack Swift though. |
I was curious and did some digging and came up with a theory for this. It appears that the ObjectStore Storage implementation puts the file contents into the php temp stream, which is passed to the S3 uploader, which for whatever reason tries to reopen the underlying file of the stream, which happens to be the php temp stream, which is not reusable by passing its uri and is thus empty. It's quite late, so I'm not sure if I'm completely off, but if the theory is correct, it predicts that you might also not be able to create text files with the files app (if the files app is not using some sort of streaming upload for those that requires creating a temp file). |
I'm able to create new text files just fine in the Files app. |
@martyschaer Mh. That may be due to the way the files app works. SInce it uses WebDAV there probably are differences, which render the prediction inapplicable. A quick fix, if the above theory is correct, would be to pass the contents as a stream to putContents(), which forces nextcloud to write the stream to disk in a temp file and thus avoids the failing S3 upload, as the aws uploader now has an actual file to work with instead of the temp stream. |
Nice, @marcelklehr ! Thanks for your great analysis! 🎉 One question: will #343 still be required after merging nextcloud/server#16397 ? |
I'm happy to help :) The notes pr is not required for those releases of nextcloud that have the patch, but for backwards compatiblity you might want to use it anyway. But then again, the nextcloud pr might get backported, so 🤷♂️ |
Thanks, let's see if my backport request will be fulfilled. I think that would be better than having a temporary workaround in the notes app. |
Server PR is merged 😉 |
Nice, the issue was fixed in Nextcloud Server for Nextcloud 15, 16 and 17. 🎉 Please install the next server (patch) release. I'm closing this issue now, since we don't need a workaround patch in the notes app anymore. Thanks again to @marcelklehr ! |
After upgrading from Nextcloud 15 to 16, the Notes webapp throws an error when I click on the 'New note' button.
Here is the stacktrace from the logs:
I tried removing the app and reinstalling it, but still get the same error. The interesting thing is that the new note is actually created and will show up in the webapp if the page is refreshed.
Any suggestions would be much appreciated! Thank you!
Server configuration detail
Operating system: Linux 4.15.0-50-generic #54-Ubuntu SMP Mon May 6 18:46:08 UTC 2019 x86_64
Webserver: Caddy/v1.0.0 (fpm-fcgi)
Database: pgsql PostgreSQL 10.8 on x86_64-pc-linux-musl, compiled by gcc (Alpine 8.3.0) 8.3.0, 64-bit
PHP version: 7.3.6
Modules loaded: Core, date, libxml, openssl, pcre, sqlite3, zlib, ctype, curl, dom, fileinfo, filter, ftp, hash, iconv, json, mbstring, SPL, PDO, session, posix, readline, Reflection, standard, SimpleXML, pdo_sqlite, Phar, tokenizer, xml, xmlreader, xmlwriter, mysqlnd, cgi-fcgi, apcu, exif, gd, imagick, intl, ldap, memcached, pcntl, pdo_mysql, pdo_pgsql, redis, sodium, zip, Zend OPcache
Nextcloud version: 16.0.1 - 16.0.1.1
External storages: yes
Encryption: no
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.90 Safari/537.36
The text was updated successfully, but these errors were encountered: