alik0211 / mtproto-core

Telegram API JS (MTProto) client library for Node.js and browser
https://mtproto-core.js.org
GNU General Public License v3.0
625 stars 111 forks source link

Error: EPERM: operation not permitted, rename #260

Open vmail opened 2 years ago

vmail commented 2 years ago

Hi, I get the following error

Error: EPERM: operation not permitted, rename 'D:\Development\1.json.2192667871' -> 'D:\Development\1.json' at Object.renameSync (node:fs:980:3) at Function.writeFileSync [as sync] (D:\Development\node_modules\write-file-atomic\index.js:244:8) at Configstore.set all [as all] (D:\Development\node_modules\configstore\index.js:61:20) at Configstore.set (D:\Development\node_modules\configstore\index.js:91:12) at Storage.set (D:\Development\node_modules\@mtproto\core\src\storage\index.js:12:44) at RPC.setStorageItem (D:\Development\node_modules\@mtproto\core\src\rpc\index.js:772:33) at RPC.handleDecryptedMessage (D:\Development\node_modules\@mtproto\core\src\rpc\index.js:485:20) at RPC.handleEncryptedMessage (D:\Development\node_modules\@mtproto\core\src\rpc\index.js:451:10) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5)

I believe the error is coming from this line, the error happens at random.

const mtproto = new MTProto({ api_id, api_hash,

storageOptions: { path: path.resolve(__dirname, './1.json'), }, });

I belive that this is why I have to keep entering the phone code every time the code starts

vmail commented 2 years ago

This error was fixed by disabling the backup software.

The only problem I have now is that I have to keep entering the phone code every time I start node. The storage file is being written to but it looks like it not being looked at at the start

darkblazeGG commented 1 year ago

I got the same problem on my server, reinstall OS, tried other cases, how did you disabled backup storage in mtproto?

shalevc1098 commented 9 months ago

i have this too. how do i fix that?