Closed Bug 1649353 Opened 2 years ago Closed 2 years ago

Automatic updating on Windows might fail due to PermissionError with log file

Categories

(Conduit :: moz-phab, defect, P2)

x86_64
Windows

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: jya, Assigned: glob)

Details

(Keywords: conduit-triaged)

Attachments

(3 files)

Unfortunately, I can't provide the full log as it will quickly overflow the terminal buffer.

When pushing a new review; and moz-phab needs to update it will self-update and then output mega-bytes of hexa code ;

Until very recently that self-update would have caused a failure about some file being in use; now it continues as normal, with those hexa codes.

Looks like this.

a744d804164 ab2a7627fd72b77c87c098ad0ebb41e547c98d73\n13b7bf6d6592f6dec5714f5254e87649d60ae8d9 d52f0708fef5634fe0c0c5236fe5fa744d804164\n01ac19e1602069cd3c6e70c6f0b46cee14c23051 13b7bf6d6592f6dec5714f5254e87649d60ae8d9\nb80d13d35786c5eaecd6c1ffb2804abab06f3b30 01ac19e1602069cd3c6e70c6f0b46cee14c23051\nb1125a79b7dda3e23ff8423b8d30a1ccd58e3f5a b80d13d35786c5eaecd6c1ffb2804abab06f3b30\n83322b77f21546852f9017a9b9b4f9d58e66260e b1125a79b7dda3e23ff8423b8d30a1ccd58e3f5a\n3702a74d41e431a79deb7c2c9e5b8fb61bd351c2 83322b77f21546852f9017a9b9b4f9d58e66260e\nc5cef1db7dc3f12f700f6c2d100e333490574be3 3702a74d41e431a79deb7c2c9e5b8fb61bd351c2\n5983aa1b5d9e4c4958ed1014dc34681b8b6fa246 c5cef1db7dc3f12f700f6c2d100e333490574be3\n5855b900b43dffd2b6c54f8bf3ebce4c3346e86d 5983aa1b5d9e4c4958ed1014dc34681b8b6fa246\ne8f0d0fe8b8bfc9430df13bfdbf62a5817c9b8a8 5855b900b43dffd2b6c54f8bf3ebce4c3346e86d\n66c72d72404dfb6760e608a22682c9791078e834 e8f0d0fe8b8bfc9430df13bfdbf62a5817c9b8a8\n3dbd67b440c6f7d7df625317f31f7da8425ed94c 66c72d72404dfb6760e608a22682c9791078e834\n2863f6b6176e3a8c272568a59e7ec5a7ca445a7f 3dbd67b440c6f7d7df625317f31f7da8425ed94c\n0432da1812dd299685b36eeead75da9c4e19b502 2863f6b6176e3a8c272568a59e7ec5a7ca445a7f\n6809e15f6feb1f80ef7956e9ed4cd444fe773d94 0432da1812dd299685b36eeead75da9c4e19b502\n84abeed378e528dd6c7ac3e6891133ed5d30ea18 6809e15f6feb1f80ef7956e9ed4cd444fe773d94\n4a6711da24afe9119ecb7ee2ab31e370b172ff33 84abeed378e528dd6c7ac3e6891133ed5d30ea18\n6e7c8f4e6ac0c8d1289d2fdfd6b6b91495e112d4 4a6711da24afe9119ecb7ee2ab31e370b172ff33\n74bce460eaf52176e75ec66809dd08d2be77789c 6e7c8f4e6ac0c8d1289d2fdfd6b6b91495e112d4\nddef6cad1578d2ed566ea92a1128a9b7a2c8810a 74bce460eaf52176e75ec66809dd08d2be77789c\n521da04f8589fc4eee19671d6c7a97c6e0fea1d8 ddef6cad1578d2ed566ea92a1128a9b7a2c8810a\n191b77db993957958a7a12bc97608c34b3fa0a13 521da04f8589fc4eee19671d6c7a97c6e0fea1d8\n5bd655594eae70e5503745a8bc5a454e008a0f99 191b77db993957958a7a12bc97608c34b3fa0a13\ndb11e0f012591678a2fbcf4018a16e86b21682b4 5bd655594eae70e5503745a8bc5a454e008a0f99\n19c921d8ab4326505aa8f52b5aec553c30563632 db11e0f012591678a2fbcf4018a16e86b21682b4\n299e5283af012713c4dc1a658c59eebc4ea27d69 19c921d8ab4326505aa8f52b5aec553c30563632\n53ccb4a9242202cddfad2081a80db44b6c2acf1d 299e5283af012713c4dc1a658c59eebc4ea27d69\n5abec71effd26a327e6ac2ccc555fdbb1fbf87db 53ccb4a9242202cddfad2081a80db44b6c2acf1d\n4224652c5ecdb26fe034b819af43c07d9c50250a 5abec71effd26a327e6ac2ccc555fdbb1fbf87db\n63e21d3716019e4646324d15728739f5d254f680 4224652c5ecdb26fe034b819af43c07d9c50250a\n3aa731c7c89cc4450a31579e838ada5049ffbf66 63e21d3716019e4646324d15728739f5d254f680\n0e7318bcbd21c3d3509c4042e69952a11c4833c3 3aa731c7c89cc4450a31579e838ada5049ffbf66\n4ef4fdc1b76236ff67f9d4249eda92e4ded40122 0e7318bcbd21c3d3509c4042e69952a11c4833c3\nf547eb46da547b9a1c7a1d7d975fac12f99e3d39 4ef4fdc1b76236ff67f9d4249eda92e4ded40122\nd824d9338faf1e2722cf3370db4eb1adb52c2177 f547eb46da547b9a1c7a1d7d975fac12f99e3d39\n8c368179f48856020ef115e9165475dc07a91bbe d824d9338faf1e2722cf3370db4eb1adb52c2177\n1179444df18bd0d63fbbfaf682f9812d7db331df 8c368179f48856020ef115e9165475dc07a91bbe\nac08cb09740c82f328e78fd4e4d4f02fe106f6ba 1179444df18bd0d63fbbfaf682f9812d7db331df\nefaa4c6d3906e74e0d81563a79c1fcf1bf76fd83 ac08cb09740c82f328e78fd4e4d4f02fe106f6ba\nf5318204fa7dc0e751a3f5a6caa02a71eac2c609 efaa4c6d3906e74e0d81563a79c1fcf1bf76fd83\ndaffa873586e5dc703c98331100a4496f2fc6775 f5318204fa7dc0e751a3f5a6caa02a71eac2c609\n7b75c76b0f0713de8aa49b8ffd499178a7898d60 daffa873586e5dc703c98331100a4496f2fc6775\n315187fddf43e0ab37735b4bc7ff61de631b5c38 7b75c76b0f0713de8aa49b8ffd499178a7898d60\nc3027f33a382f7b6665733c69f8e6114decb72fb 315187fddf43e0ab37735b4bc7ff61de631b5c38\n965cfd45660220bad48d54926867ee8e3e22afad c3027f33a382f7b6665733c69f8e6114decb72fb\nac7a9ded50ae1260768fd4731c7c45200d67f6f3 965cfd45660220bad48d54926867ee8e3e22afad\n70250dc8b9b75903528d300dccde37bdab72702c ac7a9ded50ae1260768fd4731c7c45200d67f6f3\n9b3f85df686efea38b6f866e243539e4fd255850 70250dc8b9b75903528d300dccde37bdab72702c\ne4597e415ee78805cf2df8594c083056e35e2d24 9b3f85df686efea38b6f866e243539e4fd255850\n9b54825de11299ab6cd0de74f41ad48f6ce9ee56 e4597e415ee78805cf2df8594c083056e35e2d24\n2b0bd7e18f131d24b8d2a02bcedc9278637ad011 9b54825de11299ab6cd0de74f41ad48f6ce9ee56\n09d7a054da2956d88aa2d42bb6606f0724256a22 2b0bd7e18f131d24b8d2a02bcedc9278637ad011\n39af68bb6aa83f311b31dc26aaf8e3777a44e1ef 09d7a054da2956d88aa2d42bb6606f0724256a22\n321b9b970e131357b4e84530d36aa9965732e482 39af68bb6aa83f311b31dc26aaf8e3777a44e1ef\nc2717636393bfcb32e386c63ef63abaca2212218 321b9b970e131357b4e84530d36aa9965732e482\nf15deb6dead41d603cbb4bff3a49d7c46d5ae8aa c2717636393bfcb32e386c63ef63abaca2212218\n7d337807e251feeaad5ec995fc459d0cd83eea5c f15deb6dead41d603cbb4bff3a49d7c46d5ae8aa\n76614f6c886e7700115bff94e0049e16d2edc324 7d337807e251feeaad5ec995fc459d0cd83eea5c\n3289ad3b42a97ea22690dde8b3f37706c7094f38 76614f6c886e7700115bff94e0049e16d2edc324\n5e2a13edf0485939c8238bedac1c3feca7e30548 3289ad3b42a97ea22690dde8b3f37706c7094f38\n460e38e1553324586191d2707421a56921450272 5e2a13edf0485939c8238bedac1c3feca7e30548\nf89a0fa1b9de50efa4563f784f60fb885b805d6f 460e38e1553324586191d2707421a56921450272\n786bc089cbf288d9985e62dc9837a30400da7843 f89a0fa1b9de50efa4563f784f60fb885b805d6f\nc57c77f25f038d28f8e0259e357059a796a2872b 786bc089cbf288d9985e62dc9837a30400da7843\n04d1c7c24bf2fa91fa4af8fc43008754351c18f7 c57c77f25f038d28f8e0259e357059a796a2872b\nfc534582052bb3971a866a6e88660808e43b5327 04d1c7c24bf2fa91fa4af8fc43008754351c18f7\n1927bbf87f54e354ea306a3ff6b312059b34d87a fc534582052bb3971a866a6e88660808e43b5327\n71cc0262db7d87b3b77b5c1a2bafa30c08b7b6ab 1927bbf87f54e354ea306a3ff6b312059b34d87a\n44f49e3ed404691b40b1d7a130d79d795242a760 71cc0262db7d87b3b77b5c1a2bafa30c08b7b6ab\n00e2bbe5687ab98dd12068e467dc4f0e52228c3b 44f49e3ed404691b40b1d7a130d79d795242a760\n9399894c205c045ba019ecf59ed6ac8526ff2c20 00e2bbe5687ab98dd12068e467dc4f0e52228c3b\nea0e1f623be78e9bf93f713b1d5e1ce32f8f9bd6 9399894c205c045ba019ecf59ed6ac8526ff2c20\n53dccd8d13fc609fe804cfb5a8a99db6945d6bdc ea0e1f623be78e9bf93f713b1d5e1ce32f8f9bd6\n538bfc70f798692056d4c04ab231017ef8a528ad 53dccd8d13fc609fe804cfb5a8a99db6945d6bdc\nf40ab6963591a83b84221c6d728c0f28cc028705 538bfc70f798692056d4c04ab231017ef8a528ad\n028eb027b27555a06b074fc113d3457adc195a0a f40ab6963591a83b84221c6d728c0f28cc028705\n859d6c246bf8db326439ec602a4ae3454f364156 028eb027b27555a06b074fc113d3457adc195a0a\n21bf56a6836ef11b645ff2e321bfa412b52ba895 859d6c246bf8db326439ec602a4ae3454f364156\nf03337addd9f1bfeb64b51652315584ec3ca2996 21bf56a6836ef11b645ff2e321bfa412b52ba895\n34099152173b8d3da22873add009a05559689b08 f03337addd9f1bfeb64b51652315584ec3ca2996\n96bb783e962ce67b4bbf6bca3aa0486c7e5cd065 34099152173b8d3da22873add009a05559689b08\ne4740d91e45ca4ef6df98f25c65c64f5bd48684c 96bb783e962ce67b4bbf6bca3aa0486c7e5cd065\n2fe911681cc8e3aabef9999ed3aa2ea65b92f269 e4740d91e45ca4ef6df98f25c65c64f5bd48684c\nbc4b72ec4afbe6ce4785fe4bc4b8597c3df8d84e 2fe911681cc8e3aabef9999ed3aa2ea65b92f269\n4fddf45c20f8b9567f5a147c7c62e7c3f5322b10 bc4b72ec4afbe6ce4785fe4bc4b8597c3df8d84e\n03a2940b059e090cf84d0ac1bae553a90b2018df 4fddf45c20f8b9567f5a147c7c62e7c3f5322b10\n463831ae2e5073926e859651faaf6e3b3c558a47 03a2940b059e090cf84d0ac1bae553a90b2018df\nb7b21b25c5e73cbd6e7b7e66b8210b3dc149302a 463831ae2e5073926e859651faaf6e3b3c558a47\nd61e8488168ad0a44ec4af12c3f24c255cb759df b7b21b25c5e73cbd6e7b7e66b8210b3dc149302a\n46afccb5dfbbc02429b32657b08c48d3420b88fd d61e8488168ad0a44ec4af12c3f24c255cb759df\ndee33bfcdb9ecc9669bdf67e5b0b104e759155c4 46afccb5dfbbc02429b32657b08c48d3420b88fd\naa5fff1d4958722bde2922de46491ef203c900b2 dee33bfcdb9ecc9669bdf67e5b0b104e759155c4\nf1436e0924483372849f3da31f8980091751605e aa5fff1d4958722bde2922de46491ef203c900b2'
Arguments: ()
Submitting 1 commit for review:
(D81334) 1b06cada6164 Bug 1648898 - Fix data race on STS loop start. r?valentin,mayhemer
Submit to https://phabricator.services.mozilla.com (YES/No/Always)?
Summary: When moz-phab is self-updating it will output MB of hexa code → When moz-phab is self-updating on Windows it will output MB of hexa code

I can't replicate.
I think it might be related to the system configuration (I tried on macOS and Windows within the mozilla-build shell).
This looks a little like throwing the log to the terminal, but no idea why it would happen.
What is your setup?

Flags: needinfo?(jyavenard)
Attached file logs.txt
Flags: needinfo?(jyavenard)

It happened again today, except that this time I was able to capture the console before it got overfilled with the rubbish ascii.

logs attached.

the last line is obviously truncated, within the 2s I managed to capture the console that line was already 1.2MB long

I only ever experience this on Windows (I set the platform to Windows intel for this bug)

It's Windows 10, running the latest mozilla-build package; I'm using git.

Thanks jya; here's the relevant part of the log:

Traceback (most recent call last):
  File "c:\mozilla-build\python3\lib\logging\handlers.py", line 72, in emit
    self.doRollover()
  File "c:\mozilla-build\python3\lib\logging\handlers.py", line 173, in doRollover
    self.rotate(self.baseFilename, dfn)
  File "c:\mozilla-build\python3\lib\logging\handlers.py", line 113, in rotate
    os.rename(source, dest)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'c:\\Users\\jyavenard\\.mozbuild\\moz-phab\\moz-phab.log' -> 'c:\\Users\\jyavenard\\.mozbuild\\moz-phab\\moz-phab.log.1'
Call stack:

Had the same issue happen on my windows10 laptop tonight as it self-upgraded.

Severity: -- → S2
Priority: -- → P2

I've tried to force this issue to occur however I've been unable to so far.

I'll continue to investigate to work around the root cause, however we shouldn't be pushing the output of git rev-list --all… into the log; that'll make this error message readable when it happens, and will reduce the size of the logs and therefore the rotation frequency.

Assignee: nobody → glob
Summary: When moz-phab is self-updating on Windows it will output MB of hexa code → Automatic updating on Windows migth fail due to PermissionError with log file

On mozilla-central this is over 500k lines long.

Summary: Automatic updating on Windows migth fail due to PermissionError with log file → Automatic updating on Windows might fail due to PermissionError with log file

Due to file locking on Windows it's possible for the newly updated
moz-phab command to fail if log rotation is required, as the original
process still has the log file open.

Explicitly closing the logs before spawning the upgraded executable
should resolve this issue.

Depends on D87999

You need to log in before you can comment on or make changes to this bug.