{"thread":{"id":"50165","subject":"\"git p4\" fails when perforce login not needed","startedAt":"2019-01-06T22:48:41Z","lastAt":"2019-01-07T23:56:55Z","messageCount":3,"participants":["Peter Osterlund","Luke Diamand","Mazo, Andrey"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"366226","messageId":"alpine.LFD.2.21.1901062337420.5908@fractal.localdomain","threadId":"50165","inReplyTo":null,"subject":"\"git p4\" fails when perforce login not needed","fromName":"Peter Osterlund","fromEmail":"peterosterlund2@gmail.com","sentAt":"2019-01-06T22:48:32Z","receivedAt":"2019-01-06T22:48:41Z","isPatch":false,"sender":{"key":"peterosterlund2@gmail.com","avatar":null},"body":"Hi,\n\nWhen I use \"git p4 sync\" to update a git repository from a perforce depot, \nthe operation fails with error message:\n\n     failure accessing depot: unknown error code info\n\nWhen I run \"p4 login -s\" from a shell it reports:\n\n     'login' not necessary, no password set for this user.\n\nThe following patch fixes the problem for me:\n\n--- /usr/libexec/git-core/git-p4~        2018-12-15 14:51:07.000000000 +0100\n+++ /usr/libexec/git-core/git-p4      2019-01-06 23:23:06.934176387 +0100\n@@ -332,6 +332,8 @@\n              die_bad_access(\"p4 error: {0}\".format(data))\n          else:\n              die_bad_access(\"unknown error\")\n+    elif code == \"info\":\n+        return\n      else:\n          die_bad_access(\"unknown error code {0}\".format(code))\n\n\nNot sure if this helps, but running \"p4 -G login -s | hexdump\" gives:\n\n00000000  7b 73 04 00 00 00 63 6f  64 65 73 04 00 00 00 69  |{s....codes....i|\n00000010  6e 66 6f 73 05 00 00 00  6c 65 76 65 6c 69 00 00  |nfos....leveli..|\n00000020  00 00 73 04 00 00 00 64  61 74 61 73 35 00 00 00  |..s....datas5...|\n00000030  27 6c 6f 67 69 6e 27 20  6e 6f 74 20 6e 65 63 65  |'login' not nece|\n00000040  73 73 61 72 79 2c 20 6e  6f 20 70 61 73 73 77 6f  |ssary, no passwo|\n00000050  72 64 20 73 65 74 20 66  6f 72 20 74 68 69 73 20  |rd set for this |\n00000060  75 73 65 72 2e 30                                 |user.0|\n00000066\n\nBest regards,\n\n-- \nPeter Osterlund - peterosterlund2@gmail.com\nhttp://hem.bredband.net/petero2b\n"},{"id":"366247","messageId":"CAE5ih78_w0kt0g73tAn1gH=zcGJAdmFWWhWn29cmT6gS_tdKug@mail.gmail.com","threadId":"50165","inReplyTo":"alpine.LFD.2.21.1901062337420.5908@fractal.localdomain","subject":"Re: \"git p4\" fails when perforce login not needed","fromName":"Luke Diamand","fromEmail":"luke@diamand.org","sentAt":"2019-01-07T10:10:05Z","receivedAt":"2019-01-07T10:10:25Z","isPatch":false,"sender":{"key":"luke@diamand.org","avatar":"https://avatars.githubusercontent.com/u/5330967?v=4"},"body":"On Sun, 6 Jan 2019 at 22:48, Peter Osterlund <peterosterlund2@gmail.com> wrote:\n>\n> Hi,\n>\n> When I use \"git p4 sync\" to update a git repository from a perforce depot,\n> the operation fails with error message:\n>\n>      failure accessing depot: unknown error code info\n>\n> When I run \"p4 login -s\" from a shell it reports:\n>\n>      'login' not necessary, no password set for this user.\n>\n> The following patch fixes the problem for me:\n\nThat's my fault!\n\nYour fix looks good, thanks!\n\nLuke\n\n\n>\n> --- /usr/libexec/git-core/git-p4~        2018-12-15 14:51:07.000000000 +0100\n> +++ /usr/libexec/git-core/git-p4      2019-01-06 23:23:06.934176387 +0100\n> @@ -332,6 +332,8 @@\n>               die_bad_access(\"p4 error: {0}\".format(data))\n>           else:\n>               die_bad_access(\"unknown error\")\n> +    elif code == \"info\":\n> +        return\n>       else:\n>           die_bad_access(\"unknown error code {0}\".format(code))\n>\n>\n> Not sure if this helps, but running \"p4 -G login -s | hexdump\" gives:\n>\n> 00000000  7b 73 04 00 00 00 63 6f  64 65 73 04 00 00 00 69  |{s....codes....i|\n> 00000010  6e 66 6f 73 05 00 00 00  6c 65 76 65 6c 69 00 00  |nfos....leveli..|\n> 00000020  00 00 73 04 00 00 00 64  61 74 61 73 35 00 00 00  |..s....datas5...|\n> 00000030  27 6c 6f 67 69 6e 27 20  6e 6f 74 20 6e 65 63 65  |'login' not nece|\n> 00000040  73 73 61 72 79 2c 20 6e  6f 20 70 61 73 73 77 6f  |ssary, no passwo|\n> 00000050  72 64 20 73 65 74 20 66  6f 72 20 74 68 69 73 20  |rd set for this |\n> 00000060  75 73 65 72 2e 30                                 |user.0|\n> 00000066\n>\n> Best regards,\n>\n> --\n> Peter Osterlund - peterosterlund2@gmail.com\n> http://hem.bredband.net/petero2b\n"},{"id":"366303","messageId":"20190107235640.32067-1-amazo@checkvideo.com","threadId":"50165","inReplyTo":"alpine.LFD.2.21.1901062337420.5908@fractal.localdomain","subject":"Re: \"git p4\" fails when perforce login not needed","fromName":"Mazo, Andrey","fromEmail":"amazo@checkvideo.com","sentAt":"2019-01-07T23:56:49Z","receivedAt":"2019-01-07T23:56:55Z","isPatch":false,"sender":{"key":"amazo@checkvideo.com","avatar":null},"body":"On Sun, 6 Jan 2019 at 22:48, Peter Osterlund <peterosterlund2@gmail.com> wrote:\n> Hi,\n> \n> When I use \"git p4 sync\" to update a git repository from a perforce depot, \n> the operation fails with error message:\n> \n>      failure accessing depot: unknown error code info\n>\n\nI guess, this got broken in\ncommit 0ef67acdd78 (\"git-p4: better error reporting when p4 fails\", 2018-06-08)\n\n> When I run \"p4 login -s\" from a shell it reports:\n> \n>      'login' not necessary, no password set for this user.\n\nIn my case, I was getting (this is pretty printed `p4 -G` output):\n    {b'code': b'info', b'level': 0, b'data': b'User <username> was authenticated by password not ticket.'}\n\nI guess, that's because I have P4PASSWD variable exported and/or git-p4.password set.\n\n\n> The following patch fixes the problem for me:\n> \n> --- /usr/libexec/git-core/git-p4~        2018-12-15 14:51:07.000000000 +0100\n> +++ /usr/libexec/git-core/git-p4      2019-01-06 23:23:06.934176387 +0100\n> @@ -332,6 +332,8 @@\n>               die_bad_access(\"p4 error: {0}\".format(data))\n>           else:\n>               die_bad_access(\"unknown error\")\n> +    elif code == \"info\":\n> +        return\n>       else:\n>           die_bad_access(\"unknown error code {0}\".format(code))\n\nThis fixes the problem for me too.\n\n> \n> Not sure if this helps, but running \"p4 -G login -s | hexdump\" gives:\n> \n> 00000000  7b 73 04 00 00 00 63 6f  64 65 73 04 00 00 00 69  |{s....codes....i|\n> 00000010  6e 66 6f 73 05 00 00 00  6c 65 76 65 6c 69 00 00  |nfos....leveli..|\n> 00000020  00 00 73 04 00 00 00 64  61 74 61 73 35 00 00 00  |..s....datas5...|\n> 00000030  27 6c 6f 67 69 6e 27 20  6e 6f 74 20 6e 65 63 65  |'login' not nece|\n> 00000040  73 73 61 72 79 2c 20 6e  6f 20 70 61 73 73 77 6f  |ssary, no passwo|\n> 00000050  72 64 20 73 65 74 20 66  6f 72 20 74 68 69 73 20  |rd set for this |\n> 00000060  75 73 65 72 2e 30                                 |user.0|\n> 00000066\n> \n> Best regards,\n"}]}