Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Cannot save files #999

Open
Klemich opened this issue Oct 4, 2021 · 9 comments
Open

Cannot save files #999

Klemich opened this issue Oct 4, 2021 · 9 comments
Labels

Comments

@Klemich
Copy link

Klemich commented Oct 4, 2021

Describe the bug
cannot save edited file. Just get a pop-up box message tell me "cannot save file". Either with shortcut or through the menu.

error.log :

[04-Oct-2021 16:59:15 Asia/Chongqing] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /var/www/php/icecoder/lib/settings-screen.php on line 210
[04-Oct-2021 16:59:15 Asia/Chongqing] PHP Notice:  Trying to access array offset on value of type bool in /var/www/php/icecoder/lib/settings-screen.php on line 217

dev console :
Uncaught TypeError: this.content.style is undefined
icecoder.js:3131 : : parseInt(this.content.style.height, 10) / thisCM.lineCount())
it would seem that the browser doesn't like the ":" at the start of the line.

Uncaught (in promise) SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

This site appears to use a scroll-linked positioning effect. This may not work well with asynchronous panning; see https://firefox-source-docs.mozilla.org/performance/scroll-linked_effects.html for further details and to join the discussion on related tools and features!

problem on editor.php

Screenshots
image

Browser & Server (please complete the following information):

  • Browser : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0
  • Server : Linux (Ubuntu server 20.04 LTS) on Nginx/1.20.1
  • PHP : 7.4
  • Icecoder : 8.1
  • Codemirror : 5.20.3
@Klemich Klemich added the Bug label Oct 4, 2021
@Klemich
Copy link
Author

Klemich commented Nov 10, 2021

Hi,

nothing has changed, I still can't edit online. Care to help ?

@mattpass
Copy link
Collaborator

Hi @Klemich - there's a few errors to consider here and I think the JS errors already present are stopping you from saving any content. Everything seems to relate to permissions on your server somehow.

Going through them in order...

[04-Oct-2021 16:59:15 Asia/Chongqing] PHP Warning:  count(): Parameter must be an array or an object that implements Countable in /var/www/php/icecoder/lib/settings-screen.php on line 210
[04-Oct-2021 16:59:15 Asia/Chongqing] PHP Notice:  Trying to access array offset on value of type bool in /var/www/php/icecoder/lib/settings-screen.php on line 217

Both of these seem to errors relate to having no dir listing for ICEcoder's backup dir. Is it there and ICEcoder has access rights to write to it? I can make some error handling adjustments here to avoid an error, but would be good to know if there's a backups dir in ICEcoder and if it has write access rights?

Uncaught TypeError: this.content.style is undefined
icecoder.js:3131 : : parseInt(this.content.style.height, 10) / thisCM.lineCount())

...this would seem to be triggered by trying to find in content when there is no content as the actual complaint was this.content.style not being available, because this.content isn't available, I'd assume because there is no content shown. Do you remember how you triggered this? Same as above, I can put some error handling in to avoid edge cases like this, but would be good to know the cause.

Uncaught (in promise) SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data

This seems like no data was loaded (end of data at line 1 column 1, ie, no JSON data at all), I would guess looking at the JS code in icecoder.js that it's because again something is blocking it on your server?

Summary
I think it all 3 cases, there's some blocking of dirs/files which causes JS errors, which then means you can't save (JS errors tend to cause more breakages thereafter). I can look into better error handling, so JS errors don't cause follow on issues (such as not being able to save), but some investigation on your server, likely re permissions, would be advisable?

@Klemich
Copy link
Author

Klemich commented Nov 19, 2021

I'm coming back to it today, I'll try to find the cause of all this. It's been a long time, I've worked offline ever since.
Thanks for the follow up.

@Klemich
Copy link
Author

Klemich commented Nov 19, 2021

so, icecoder.js permissions are like this :
-rw-r--r-- 1 www-data www-data 252264 Sep 21 17:34 icecoder.js, 644. do you need it to me 655 ?

@Klemich
Copy link
Author

Klemich commented Nov 19, 2021

here is what I get on the page once connected :
image

@mattpass
Copy link
Collaborator

@Klemich re icecoder.js, 644. do you need it to me 655 ? - No, the JS isn't of concern really and 644 is fine. It's more the permissions on the PHP files generally in ICEcoder. Did you follow step 3 from the setup?

Copied from icecoder.net Home page:

Step 3: Set write permissions

The "owner" and "group" are likely root for that ICEcoder dir (and sub-dirs & files inside). That could be be a problem if the web server is running as www-data user. So update to the right owner & group so ICEcoder's able to work.

This can be done easily on Linux with:
chown -R www-data.www-data ICEcoder

Far more concerning - I've no clue what content-ads.js, content-tss.js and content-scripts.js are - they're certainly not part of ICEcoder. I can't tell if your web hosting is messing with permissions, adding/changing JS or another issue, but generally seems to be something on your server setup that is causing real problems. So not something I can advise on really, clearly another component is causing real problems and not allowing ICEcoder to run properly.

Maybe some overly protective security perhaps.

@Klemich
Copy link
Author

Klemich commented Nov 19, 2021

Yes, I've followed step 3
image

Apparently, the content-ads.js is a mozilla feature (?) moz-extension://0e756b11-eb87-4522-aa8c-fa80475c609f/content-scripts.js

@mattpass
Copy link
Collaborator

mattpass commented Nov 19, 2021

OK, some more things to check and a test perhaps:

  1. The dir for gout-cha.com site - the owner and group are both also www-data www-data?

  2. What do you have in the data dir? The following?...

  • data - perms 755 with www-data www-data
    • backups - perms 755 with www-data www-data
      • gout-cha.com - perms 755 with www-data
        • (dated dirs, eg 2021-11-19) - perms 755 with www-data www-data
          • (files in here maybe) - perms 644 with www-data www-data
  1. What happens if in ICEcoder you go to the Settings > General menu and in the options show, under Backups, uncheck keep version control for X days - save, reload ICEcoder in browser and try again?

@Klemich
Copy link
Author

Klemich commented Jan 17, 2022

Hi,

sorry for the delayed answer.
I'm getting back to it now.

Question 1 : yup, all www-data
Question 2 : my root is in var/www, would that be the problem ?
Question 3 : for a moment I thought it would, but eventually didn't change anything.

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

No branches or pull requests

2 participants