Artawower / orgnote

Zettelkasten environment for productive people
GNU General Public License v3.0
313 stars 3 forks source link

[Bug] sync is not working anymore #26

Open SemyonSinchenko opened 1 week ago

SemyonSinchenko commented 1 week ago

Thank you for the bug report

Bug description and steps to reproduce

I have local notes and regularly do orgnote-cli sync but after I run foce-sync in the web app / android all my notes diapered. At the same time, orgnote-cli sync is successful locally.

⬢[sem@toolbox ~]$ orgnote-cli sync --debug
2024-10-09T11:36:30.435Z-info: info.message
info: Current configuration: {
  remoteAddress: 'https://org-note.com/api/v1',
  token: 'xxx',
  rootFolder: '/var/home/sem/Nextcloud/ORG/orgnote',
  version: 'v1',
  logPath: '~/var/logs/orgnote.log',
  backupCount: 2,
  name: 'Main',
  backupDir: '/var/home/sem/Nextcloud/Backup/Orgnote',
  encrypt: 'gpgPassword',
  gpgPassword: 'xxx',
  _: [ 'sync', [length]: 1 ],
  debug: true,
  '$0': '/usr/local/bin/orgnote-cli'
}
[line 64]: LOG FILE ALREADY EXISTS ~/var/logs/orgnote.log
2024-10-09T11:36:30.438Z-info: info.message
info: ✎: [backup.ts][Wed Oct 09 2024 13:36:30 GMT+0200 (Central European Summer Time)] old backups will be deleted [ '2024-10-09T11:16:29.914Z.zip', [length]: 1 ]
2024-10-09T11:36:30.438Z-info: info.message
info: ✎: [backup.ts][Wed Oct 09 2024 13:36:30 GMT+0200 (Central European Summer Time)] backups stored into '/var/home/sem/Nextcloud/Backup/Orgnote/2024-10-09T11:36:30.438Z.zip'
2024-10-09T11:36:30.511Z-info: info.message
info: ✎: [sync-notes.ts][Wed Oct 09 2024 13:36:30 GMT+0200 (Central European Summer Time)] last sync from 2024-10-09T11:33:56.998Z
2024-10-09T11:36:30.512Z-info: info.message
info: ✎: [sync-notes.ts][Wed Oct 09 2024 13:36:30 GMT+0200 (Central European Summer Time)] encryption changed from the last sync false
2024-10-09T11:36:30.514Z-info: info.message
info: ✎: [sync-notes.ts][Wed Oct 09 2024 13:36:30 GMT+0200 (Central European Summer Time)] files found to sync 0
2024-10-09T11:36:30.515Z-info: info.message
info: ✎: [sync-notes.ts][Wed Oct 09 2024 13:36:30 GMT+0200 (Central European Summer Time)] notes from last sync:
 [ [length]: 0 ]
2024-10-09T11:36:30.517Z-info: info.message
info: Files to sync: 
2024-10-09T11:36:30.518Z-info: info.message
info: Files length to send: 0
2024-10-09T11:36:30.771Z-info: info.message
info: ✎: [sync-notes.ts][Wed Oct 09 2024 13:36:30 GMT+0200 (Central European Summer Time)] 
  notes updated from remote:
    [ [length]: 0 ]
  notes ids to delete:
    [ [length]: 0 ]

I'm 100% using the right token and URL, I checked it multiple times before posting an issue.

I have also some problems with orgnote-cli:

⬢[sem@toolbox ~]$ orgnote-cli --version
unknown
⬢[sem@toolbox ~]$ orgnote-cli publish-all --debug
2024-10-09T11:39:02.523Z-info: info.message
info: Current configuration: {
  remoteAddress: 'https://org-note.com/api/v1',
  token: 'xxx',
  rootFolder: '/var/home/sem/Nextcloud/ORG/orgnote',
  version: 'v1',
  logPath: '~/var/logs/orgnote.log',
  backupCount: 2,
  name: 'Main',
  backupDir: '/var/home/sem/Nextcloud/Backup/Orgnote',
  encrypt: 'gpgPassword',
  gpgPassword: 'xxx',
  _: [ 'publish-all', [length]: 1 ],
  debug: true,
  '$0': '/usr/local/bin/orgnote-cli'
}
[line 64]: LOG FILE ALREADY EXISTS ~/var/logs/orgnote.log
2024-10-09T11:39:02.526Z-info: info.message
info: ✎: [backup.ts][Wed Oct 09 2024 13:39:02 GMT+0200 (Central European Summer Time)] old backups will be deleted [ '2024-10-09T11:16:52.202Z.zip', [length]: 1 ]
2024-10-09T11:39:02.526Z-info: info.message
info: ✎: [backup.ts][Wed Oct 09 2024 13:39:02 GMT+0200 (Central European Summer Time)] backups stored into '/var/home/sem/Nextcloud/Backup/Orgnote/2024-10-09T11:39:02.526Z.zip'
2024-10-09T11:39:02.605Z-error: info.message
error: Unexpected error: Error: ENOENT: no such file or directory, stat 'publish-all'
    at statSync (node:fs:1665:25)
    at file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72374:54
    at step (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72268:23)
    at Object.next (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72249:53)
    at file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72243:71
    at new Promise (<anonymous>)
    at prepare_note_awaiter (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72239:12)
    at prepareNotes (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72369:12)
    at file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72703:32
    at step (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72655:23) {
  [stack]: "Error: ENOENT: no such file or directory, stat 'publish-all'\n" +
    '    at statSync (node:fs:1665:25)\n' +
    '    at file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72374:54\n' +
    '    at step (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72268:23)\n' +
    '    at Object.next (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72249:53)\n' +
    '    at file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72243:71\n' +
    '    at new Promise (<anonymous>)\n' +
    '    at prepare_note_awaiter (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72239:12)\n' +
    '    at prepareNotes (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72369:12)\n' +
    '    at file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72703:32\n' +
    '    at step (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:72655:23)',
  [message]: "ENOENT: no such file or directory, stat 'publish-all'",
  errno: -2,
  code: 'ENOENT',
  syscall: 'stat',
  path: 'publish-all'
}
node:fs:2376
    validateStringAfterArrayBufferView(data, 'data');
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Error
    at writeFileSync (node:fs:2376:5)
    at file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:73708:51
    at step (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:73649:23)
    at Object.throw (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:73630:53)
    at rejected (file:///usr/local/lib/node_modules/orgnote-cli/dist/index.js:73622:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Node.js v20.17.0

May it it be anyhow related to my problem with missing notes in web/android?

Debug info

OrgNote: 0.21.8 Language: en-US

Screen: Screen resolution: 1920x1200 Screen color depth: 24 Device pixel ratio: 1.25

Encryption: Type: gpgPassword Password provided: true

Env: API URL: https://org-note.com/api/v1/ AUTH URL: MODE: production

Quasar info: chrome: true version: 129.0.0.0 versionNumber: 129 linux: true desktop: true webkit: true name: chrome platform: linux standalone: false

Additional context

No response

Artawower commented 1 week ago

Can you try press force sync again? (androi/web version)

One of the upcoming migrations was incompatible with the old code.

Still investigating a local bug related to orgnote-cli

SemyonSinchenko commented 1 week ago

Thanks, force sync works fine now!