wiki icon indicating copy to clipboard operation
wiki copied to clipboard

Add untracked changes not working

Open lordmathis opened this issue 7 years ago • 6 comments

Describe the bug After setting up git storage 'Add Untracked Changes' button returns an error

To Reproduce Steps to reproduce the behavior:

  1. Set up git storage
  2. Click on 'Add Untracked Changes'
  3. See error: Network Error: JSON.parse: unexpected character at line 1 column 1 of the JSON data
  4. Docker logs show:
wiki    | 2019-09-17T20:29:28.709Z [MASTER] info: (STORAGE/GIT) Adding all untracked content...  
wiki    | 2019-09-17T20:29:28.711Z [MASTER] warn: page.getFileExtension is not a function

Expected behavior All pages are added to git and synced with remote

Host Info

  • OS: Docker
  • Wiki.js version: 2.0.0-beta.303
  • Database engine: postgres 9.6.15

Additional context Git sync works just fine. I'm able to push and pull from command line however pages that I create in wiki.js are not added to the repo

lordmathis avatar Sep 17 '19 20:09 lordmathis

Same here!

joseantonnio avatar Sep 25 '19 13:09 joseantonnio

I'm observing this too - javascript console output is:

Error: Network error: Unexpected token < in JSON at position 0 at new n (app.9a3d737249f89b3b4388.js:2) at Object.error (app.9a3d737249f89b3b4388.js:2) at _ (app.9a3d737249f89b3b4388.js:95) at b (app.9a3d737249f89b3b4388.js:95) at t.value (app.9a3d737249f89b3b4388.js:95) at app.9a3d737249f89b3b4388.js:2 at Set.forEach () at Object.error (app.9a3d737249f89b3b4388.js:2) at _ (app.9a3d737249f89b3b4388.js:95) at b (app.9a3d737249f89b3b4388.js:95)

at: admin.cf77dd6ce1448a0736fb.js:2

version: 2.0.0-beta.303 - Docker - on a sqlite DB (testing)

shushry avatar Oct 01 '19 15:10 shushry

More detail on this after some testing:

It seems that the error condition is created when you have pages that were created PRIOR to enabling the git storage module. I noticed that as some of my test users were creating pages after this fact they were getting correctly pushed to the git repo. Also, any pages that existed PRIOR to enabling git storage, and were later MODIFIED after enabling the git module, were successfully "corrected" and made it into git.

Also, attempting to delete any pages created prior, that had NOT been modified, produced an error (but did successfully delete the page).

So, it seems the issue is with any content created prior to enabling the git repo. I suspect that in the original design it was assumed that the git storage option would be enabled right after installation, before any content was created, so there's some dependency that's breaking there.

Hope that helps

shushry avatar Oct 02 '19 05:10 shushry

Fixed by 454da698a1151090e92edc0210d231cabd26ae72

NGPixel avatar Oct 07 '19 04:10 NGPixel

Fixed by 454da69

the problem still there!

beetaa avatar Dec 04 '25 00:12 beetaa

Fixed by 454da69

the problem still there!

Yes, seeing this too!

HammyHavoc avatar Jul 23 '26 07:07 HammyHavoc