nylas / nylas-mail

:love_letter: An extensible desktop mail app built on the modern web. Forks welcome!
https://nylas.com/nylas-mail/
MIT License
24.81k stars 1.37k forks source link

Error - Failed to save "config.json" #3382

Open nirvaat opened 7 years ago

nirvaat commented 7 years ago

Hi,

I have today installed the Desktop client on Windows 10. I have added 5 email accounts all from GSuite. It is working fine but I am getting an alert popup saying - "Failed to save Config.json". It is appearing randomly automatically. It gives two options "Okay" and "Try Again".

I tried to look for the issue in Git and on Google, but nothing found related to this issue. Any help is appreciated. I am liking this application and would like to fix this irritating issue.

Thank you, Rajendra

jstejada commented 7 years ago

Thanks for reporting this! We'll look into it

nirvaat commented 7 years ago

Thank you. Today there was an update in the app and I thought it is fixed but not it is still there. Also now there is another issue popping up. At random interval it is showing a red alert in bottom left saying "Cannot authenticate with google for "my-email".

emersonk commented 7 years ago

I'm also having the first issue. Also installed on Windows 10, I have an imap account, a gmail account, and an outlook account linked. I can open another issue if that is preferred. I attached a screenshot of the error.

image

IsoPhoenix commented 7 years ago

I also had this same problem. Pops up when I'm trying to change the account labels for my accounts, I try to type a new name but my text is immediately reverted to the original account label, kind of like lag. It took many many tries with clicking "Try Again" and eventually I could change the account names.

jstejada commented 7 years ago

Are people still seeing it on 2.0.15?

Thanks!

IsoPhoenix commented 7 years ago

Yes I am still seeing it. Unable to save config.json

nirvaat commented 7 years ago

Yes with new update also, the issue persists. When started it starts appearing at random intervals. When I checked there are lot of config files in the folder. And it creates a new file every few seconds, I am not sure why?

joeflateau commented 7 years ago

+1

joeflateau commented 7 years ago

FWIW, I renamed config.json to _config.json and the popup went away for a few minutes then came back

joeflateau commented 7 years ago

Nevermind. I'm an idiot. I'm out of disk space.

IsoPhoenix commented 7 years ago

I'm not out of disk space but the popup still occurs

dnlsrl commented 7 years ago

I'm having the same error, which was not fixed with 2.0.18 update. I thought it was the custom theme I loaded into it, but I removed it and the problem persists.

I don't know if it's related or not, but my inbox seems to be in a permanent state of syncing.

There's also this error line in the detailed log, again, I don't know if related:

{"host":"DESKTOP-UI5GNGK","timestamp":"2017-04-21T21:38:16.189Z","payload":"Error\n at new APIError (/src\\flux\\errors.es6:57:19)\n at Request.<anonymous> (/src\\flux\\nylas-api-request.es6:89:30)\n at emitNone (events.js:86:13)\n at Request.emit (events.js:185:7)\n at Request.abort (C:\\Users\\dnlsrl\\AppData\\Local\\NylasMail\\app-2.0.18\\resources\\app.asar\\node_modules\\request\\request.js:1096:8)\n at ClientRequest.<anonymous> (C:\\Users\\dnlsrl\\AppData\\Local\\NylasMail\\app-2.0.18\\resources\\app.asar\\node_modules\\request\\request.js:777:16)\n at ClientRequest.g (events.js:286:16)\n at emitNone (events.js:86:13)\n at ClientRequest.emit (events.js:185:7)\n at Socket.emitTimeout (_http_client.js:614:10)\n at Socket.g (events.js:286:16)\n at emitNone (events.js:86:13)\n at Socket.emit (events.js:185:7)\n at Socket._onTimeout (net.js:334:8)\n at tryOnTimeout (timers.js:232:11)\n at Timer.listOnTimeout (timers.js:202:5)"}

EDIT: Okay, reading the comments of the other thread it seems it happens after a forced shutdown, and it makes kind of sense. My computer has had two bsod already after clean installation of Windows 10 Creators Update.

pratnala commented 7 years ago

I am having this error too, and my computer is running normally - no forced shutdowns or anything. I am on Windows 10 Creators Update.

Ultrashadow commented 7 years ago

Got this issue, too. But just by clicking "Try again" it will not appear again for some time.

stevemaughan commented 7 years ago

Me too, I'm using 2.0.18. I've tried deleting the file and it still didn't fix it

savolai commented 7 years ago

Seeing this too on 2.0.18

zachthedev commented 7 years ago

Seeing this too on 2.0.18

Quite annoying, even ran program with admin rights to make sure it wasn't a permissions problem.

nirvaat commented 7 years ago

@jstejada Looks like this is related to the multiple accounts setup. Today I uninstalled Nylas Installed again and configured for one Gmail account only and it is working fine without any Config.json save alert or authentication error. Hope this helps in debugging the issue.

Edit: After 40-45 minutes the message appeared again, but once cancelled it is not there. Also the authentication error was displayed once after 50-60 from starting Nylas.

Edit: It is repeating every 45-50 minutes. When there were more accounts (5 to exact) added in the same client then it was repeating every 10-15 minutes.

jstejada commented 7 years ago

thanks for the extra info! we're still looking into this

nirvaat commented 7 years ago

Today after another update, the issue is STILL there. I am using it with one account only. But now the alert for Failed to save config.json are appearing more frequently. Earlier it was appearing after 40-45 minutes today it is appearing after every 15-20 minutes. Also the ".nylas-mail" folder in the User folder, has more than 3000 bak copies of the config.json. Why is it so?

john-landgrave commented 7 years ago

I didn't have this issue until yesterday, and now on each reboot it seems that the config.json file is getting corrupted somehow? I have to "Reset Configuration" in order to get it to boot up.

ghost commented 7 years ago

Just got version 2.0.32 and I'm having this issue as well.

Ultrashadow commented 7 years ago

The update does not solve it for me as well

kennethdesenio commented 7 years ago

I aswell just got version 2.0.32 and have the same issue with the config.json

mikeseese commented 7 years ago

I hate to be the person that says it also happens to me, but it does haha. I am not sure if its also on normal reboots, but definitely when the system crashes (for other reasons, my PC has been freezing once a week forcing me to force reboot).

Does the dev team have any idea what this might be?

KTsarlz commented 7 years ago

It keep happening on me. I've tried resetting the config, and had to reapply my accounts for the 3rd time. Never changed anything manually on the json file. Syncing 15k+ emails is a pain tbh.

nirvaat commented 7 years ago

Looks like no one is trying to fix it. It is preventing me to use the great tool you have made.

mvandevy commented 7 years ago

Having the same issue, with multiple account and not edited the config.json manually. Also tried running with admin priviledges, but that didn't change a thing. Hopefully you guys are still looking into this as it is quite annoying. The version I'm running is: 2.0.32 (the latest, as there is no update available).

andrelefevre commented 7 years ago

Same problem!!! No response from support!!!!!!!!

Escielenn commented 7 years ago

I'm encountering the same problem on both of my N1 installs-- desktop and laptop. Having to reset all of my email accounts and re-add them is a pain. It's a recurring issue and I can't find any solution. Please understand this isn't an "angry customer" threat, just communicating reality-- I'm near having to choose to not use N1 due to this. It's a fabulous program but week after week of having to re-add all my accounts only to randomly open my laptop up and have to do it again is becoming cumbersome. I would like to see some form of response from support on this. I've reviewed all of the forum posts on this and there is no solution for a problem that has been occurring since at least July 2016.

mikeseese commented 7 years ago

FYI, apparently the developers are not closely monitoring the Github repo. It seems issues should communicated through their Zendesk support at https://support.nylas.com.

I'm unsure why they have the Github repo/issues if they're not monitoring it.

sachinag-zz commented 7 years ago

We're looking, we just still can't find the root cause to stamp it out. :(

Code is public - if someone can send a PR, we'd be thrilled to review it.

andrelefevre commented 7 years ago

I really hope that you will be able to solve this soon!

Br.

-- André le Fèvre Sales Director EMEA and India Ardor Learning Inc. Global Corporate Market Distributor for

Walenburg 23, 1965 MD, Heemskerk The Netherlands Telephone: +31-20-8943702 Mobile: +31-6-51958530 Email: andre.lefevre@ardorlearning.com Web:  www.myoxfordenglish.com Web:  www.ardorlearning.com

Learning is not attained by chance, it must be sought for with ardor and diligence (Abigail Adams)

Sent from my iPad with Spark

On 23 mei 2017 20:18 +0200, Sachin Agarwal notifications@github.com, wrote:

We're looking, we just still can't find the root cause to stamp it out. :( Code is public - if someone can send a PR, we'd be thrilled to review it. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

mikeseese commented 7 years ago

@sachinag I'll take a look. I think design around config.json is prone for a couple of issues. Am I correct to assume the master branch is the latest (even though its ~1 month and 17 revision versions old)?

sachinag-zz commented 7 years ago

@seesemichaelj Yeah, it's the latest. We've been doing a lot of work on our servers, cloud APIs, etc. since that release. Thanks!

andrelefevre commented 7 years ago

Any idea when it will work????

André

--

André le Fèvre

Sales Director EMEA and India

Ardor Learning Inc.

Global Corporate Market Distributor for

--

Walenburg 23, 1965 MD, Heemskerk(x-apple-data-detectors://2/0)

The Netherlands(x-apple-data-detectors://2/0)

--

Telephone: +31-20-8943702(tel:+31-20-8943702)

Mobile: +31-6-51958530(tel:+31-6-51958530)

Email: andre.lefevre@ardorlearning.com(mailto:andre.lefevre@ardorlearning.com)

Web: www.myoxfordenglish.com(http://www.myoxfordenglish.com/)

Web: www.ardorlearning.com(http://www.ardorlearning.com/)

--

Learning is not attained by chance, it must be sought for with ardor and diligence (Abigail Adams)

--

Sent from my iPhone/iPad with AirMail

Op 23 mei 2017 om 20:30:41, Sachin Agarwal (notifications@github.com(mailto:notifications@github.com)) schreef:

@seesemichaelj(https://github.com/seesemichaelj) Yeah, it's the latest. We've been doing a lot of work on our servers, cloud APIs, etc. since that release. Thanks!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub(https://github.com/nylas/nylas-mail/issues/3382#issuecomment-303490949), or mute the thread(https://github.com/notifications/unsubscribe-auth/AbThtMpMyLENFwEKC0TkGw0d25Mhf8kmks5r8yXRgaJpZM4M8pVp).

mikeseese commented 7 years ago

@andrelefevre Unfortunately no. Open source development takes time since we all have day jobs ;)

It may be safe to assume this won't get solved for at least 2-4 weeks at the earliest given the rate of this issue as it stands.

Maybe we're lucky and it's stupid simple and somehow got around the dev team that knows the product in and out :P

andrelefevre commented 7 years ago

Ok, clear!

--

André le Fèvre

Sales Director EMEA and India

Ardor Learning Inc.

Global Corporate Market Distributor for

--

Walenburg 23, 1965 MD, Heemskerk(x-apple-data-detectors://2/0)

The Netherlands(x-apple-data-detectors://2/0)

--

Telephone: +31-20-8943702(tel:+31-20-8943702)

Mobile: +31-6-51958530(tel:+31-6-51958530)

Email: andre.lefevre@ardorlearning.com(mailto:andre.lefevre@ardorlearning.com)

Web: www.myoxfordenglish.com(http://www.myoxfordenglish.com/)

Web: www.ardorlearning.com(http://www.ardorlearning.com/)

--

Learning is not attained by chance, it must be sought for with ardor and diligence (Abigail Adams)

--

Sent from my iPhone/iPad with AirMail

Op 23 mei 2017 om 21:25:13, Mike Seese (notifications@github.com(mailto:notifications@github.com)) schreef:

@andrelefevre(https://github.com/andrelefevre) Unfortunately no. Open source development takes time since we all have day jobs ;)

It may be safe to assume this won't get solved for at least 2-4 weeks at the earliest given the rate of this issue as it stands.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub(https://github.com/nylas/nylas-mail/issues/3382#issuecomment-303505561), or mute the thread(https://github.com/notifications/unsubscribe-auth/AbThtGn2z2bBGLjBYo1be8U1_yprseh5ks5r8zKZgaJpZM4M8pVp).

Ultrashadow commented 7 years ago

@sachinag Maybe because it constantly change something on that config file. Don't understand why it should untertake such thing, when I'am not changing the settings or signature. If you do that this often (and its not a sqlite) I could imagine that Windows thinks there is a conflict from time to time and just blocks that. Idk much about the source though and don't see if there is a reason, so I'm only guessing. Can't imagine that it could be this simple D:

nirvaat commented 7 years ago

And I am not.sure why does it creates so many config.json files in the folder. I have hundred of them. What is the use of keeping so many backups.

On May 24, 2017 4:08 AM, "Ultrashadow" notifications@github.com wrote:

@sachinag https://github.com/sachinag Maybe because it constantly change something on that config file. Don't understand why it should untertake such thing, when I'am not changing the settings or signature. If you do that this often (and its not a sqlite) I could imagine that the Windows thinks there is a conflict from time to time and just blocks that. Idk much about the source though and don't see if there is a reason, so I'm only guessing. Can't imagine that it could be this simple D:

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/nylas/nylas-mail/issues/3382#issuecomment-303552774, or mute the thread https://github.com/notifications/unsubscribe-auth/AAITsJjUlBZS5iT18PvzW2b_57vmXuaDks5r81_4gaJpZM4M8pVp .

mikeseese commented 7 years ago

I have a pretty good gut feeling what one of the issues are on this one (there could be multiple causes for this symptom), and it is related to what @ultrashadow was mentioning. Every time settings are saved (at least once a minute to update the accountsVersion variable), a new settings file is created config.{randomid}.bak in the directory. Then the file is atomically renamed to the config.json file, replacing its contents.

This is happening so frequently, it is not unheard of for the file to get corrupt during the rename process. If the rename failed, the .bak file would be left there, causing the hundreds of files @nirvaat is seeing (as this happens more frequently for him than others). Different things could be the root of the file corruption: simultaneous reads/writes, slow hard drives, very frequent HDD IO, etc.

I really don't think a JSON text file is the correct format for this type of data (especially that it gets adjusted so frequently); this should probably live in a database. However, I'm going to put together some code for a hot fix which will try to eliminate the need for renaming the file and see if that prevents the problem.

Does this issue occur for anyone on a daily/weekly basis for testing purposes?

nirvaat commented 7 years ago

@seesemichaelj I am using an SSD , on my system and it is i5 with 12GB RAM (DDR3), if this matters. Also I want to mention that the error to save config.json multiplies as I add more accounts in the Nylas. This is happening every 20-30 minutes with one account, when there are 5 or more then it appears every 5-6 minutes.

Escielenn commented 7 years ago

@seesemichaelj between my two installs, it's near weekly for me.

mikeseese commented 7 years ago

@sachinag I have submitted PR #3567 as a potential solution to this issue; it fails a Travis build because your Travis CI is misconfigured and all builds fail due to some SSL stuff (I've tried to bring this to the dev's attention before, but alas, no action was taken). I have successfully built it on Linux and will try to build it on Windows tomorrow if I get a free chance.

I can distribute Linux and Windows executables for people on this chain to test, but I wanted to give your team the chance to review and take action accordingly. In the interest getting everyone here back to being productive instead of yelling at their email client, I will provide executables if we don't hear anything from the dev team in short manner :+1:

andrelefevre commented 7 years ago

Great to read!

I really hope that a solution is near. I'm not technical, but I look forward using the app without this error.

Br. André

-- André le Fèvre Sales Director EMEA and India Ardor Learning Inc. Global Corporate Market Distributor for

Walenburg 23, 1965 MD, Heemskerk The Netherlands Telephone: +31-20-8943702 Mobile: +31-6-51958530 Email: andre.lefevre@ardorlearning.com Web:  www.myoxfordenglish.com Web:  www.ardorlearning.com

Learning is not attained by chance, it must be sought for with ardor and diligence (Abigail Adams)

Sent from my iPad with Spark

On 24 mei 2017 07:30 +0200, Mike Seese notifications@github.com, wrote:

@sachinag I have submitted PR #3567 as a potential solution to this issue; it fails a Travis build because your Travis CI is misconfigured and all builds fail due to some SSL stuff (I've tried to bring this to the dev's attention before, but alas, no action was taken). I can distribute Linux and Windows executables for people on this chain to test, but I wanted to give your team the chance to review and take action accordingly. In the interest getting everyone here back to being productive instead of yelling at their email client, I will provide executables if we don't hear anything from the dev team in short manner 👍 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

nirvaat commented 7 years ago

I have just deleted 23000+ bak files created from config.json taking 70MB space. capture

Ultrashadow commented 7 years ago

@seesemichaelj Got that issue daily on both my laptop and my computer. So it would be no problem to test it. Using the app on SSDs. For what purpose does it need to change the account version so frequently?

andrelefevre commented 7 years ago

Please forgive me when I say something stupid, but that's because I'm interested in using the email program, but I'm not technical educated to fully understand the issue! Why and what makes it so difficult to find a solution??? Is there someone who can explain me this in an understandable manner? Because of this error the number of .bak files are growing every day and I have then to delete them, but then it starts over again. Once this issue has been solved I will go for the paid version, because I love this program!!!

Van: Ultrashadow notifications@github.com(mailto:notifications@github.com) Beantwoorden: nylas/nylas-mail reply@reply.github.com(mailto:reply@reply.github.com) Datum: 25 mei 2017 at 14:56:44 Aan: nylas/nylas-mail nylas-mail@noreply.github.com(mailto:nylas-mail@noreply.github.com) Cc: andrelefevre alefevre@ziggo.nl(mailto:alefevre@ziggo.nl), Mention mention@noreply.github.com(mailto:mention@noreply.github.com) Onderwerp: Re: [nylas/nylas-mail] Error - Failed to save "config.json" (#3382)

@seesemichaelj(https://github.com/seesemichaelj) Got that issue daily on both my laptop and my computer. So it would be no problem to test it. But in general, I can't understand why it needs to edit the file so frequently.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub(https://github.com/nylas/nylas-mail/issues/3382#issuecomment-304003638), or mute the thread(https://github.com/notifications/unsubscribe-auth/AbThtPHPfF0Jgc68kzGIQYCSaZXZIz5Mks5r9XqMgaJpZM4M8pVp).

nirvaat commented 7 years ago

For me in 42 minutes it created - 250+ files in .nylas-mail folder on windows 10. And the failed error was displayed 2-3 times.

Ultrashadow commented 7 years ago

@andrelefevre For finding a solution they need to identify the problem first. At the moment @seesemichaelj thinks it has something to do with frequently changing the config file. The newest .bak file will be renamed to "config.json" so it contains the latest variable of "accounts version" (just review the file with an editor). In this process, there are maybe happening I/O (read/write of HDD or SSD) issues which lead to that error message due to the high frequency of changing and renaming.