Answers.Body: <p>I encountered the same error, setting up buildkit and then running <code>amp config</code> and <code>amp test</code> on Ubuntu 19.04. </p>
  
  <p>What I figured out was that I too had initially chosen 0 for <code>perm_type</code> when running <code>amp config</code>. </p>
  
  <p>I changed the <code>perm_type</code> value to <code>linuxAcl</code> and chose <code>www-data</code> as the web user. </p>
  
  <p>Using those values then allowed me to successfully run <code>amp test</code>.   </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-10T01:29:42.370Z
Answers.LastActivityDate: 2019-09-10T01:29:42.370Z
Answers.UserDisplayName: Joe McLaughlin
Answers.Body: <p>The error was due to the permission issue but I used another method for solving this.
  At the time of amp config I chose [1] for the option perm_type, which sets the appropriate permissions according to linux.</p>
  
  <p>Option: perm_type
  Description: How to set permissions on data directories [none,custom,linuxAcl,osxAcl,worldWritable]. See <a href="https://github.com/totten/amp/blob/master/doc/perm.md" rel="nofollow">https://github.com/totten/amp/blob/master/doc/perm.md</a></p>
  
  <p>Default: none</p>
  
  <p>Enter perm_type</p>
  
  <ol>
  <li>[0] "none": Do not set any special permissions for the web user</li>
  <li>[1] "linuxAcl": Set tight, inheritable permissions with Linux ACLs
  [setfacl] (recommended)
           In some distros+filesystems, this requires extra configuration.
           eg For Debian-based distros: <a href="https://help.ubuntu.com/community/FilePermissionsACLs" rel="nofollow">https://help.ubuntu.com/community/FilePermissionsACLs</a>   </li>
  <li>[2]"osxAcl": Set tight, inheritable permissions with OS X ACLs [chmod
  +a] (recommended)   </li>
  <li>[3] "custom": Set permissions with a custom command</li>
  <li>[4] "worldWritable": Set loose, generic permissions [chmod
  1777] (discouraged)</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-19T17:23:30.967Z
Answers.LastActivityDate: 2016-04-19T17:23:30.967Z
Answers.UserDisplayName: Anjali Ujjainia
Answers.Body: <p>This might be due to permission issues, so as you mentioned that you followed <a href="https://buildkit.civicrm.org/#/tutorials" rel="nofollow">civicrm-buldkit</a> tutorials, now assuming that your buildkit is installed in <code>/opt/buildkit</code> directory I would suggest to change the permission of this directory by running the following code :</p>
  
  <pre><code>sudo chmod -R 777 /opt/buildkit
  </code></pre>
  
  <p>This command will recursively change the permission of the directory and enable all other users to create/modify/delete files and directories in it. But it is not advisable to do a 777 because of security reasons. If you are really concern about security then please look into changing the ownership of the files/directory or may be do a 755 instead with suitable arguments.</p>
  
  <p>Hope it helps.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-15T10:47:10.750Z
Answers.LastActivityDate: 2016-04-15T10:47:10.750Z
Answers.UserDisplayName: Anudit Verma
Body: <p>I had successfully ran the buildkit till got this error while running amp test. It created the test application, created data directory, set up few ports </p>
  
  <pre><code>Create data directory:/home/***/.amp/canary/data/FivN1DBNa4c05mUoshFCNDn2dHMDc01I
  AMP_URL='http://localhost:7979'
  AMP_ROOT='/home/***/.amp/canary'
  AMP_DB_DSN='mysql://canary_zcz0m:AfLQGc9SAf9Y8zno@127.0.0.1:3306/canary_zcz0m?new_link=true'
  AMP_DB_USER='canary_zcz0m'
  AMP_DB_PASS='AfLQGc9SAf9Y8zno'
  AMP_DB_HOST='127.0.0.1'
  AMP_DB_PORT='3306'
  AMP_DB_NAME='canary_zcz0m'
  AMP_DB_ARGS='-h 127.0.0.1 -u canary_zcz0m -pAfLQGc9SAf9Y8zno -P 3306 canary_zcz0m'
  
  Connect to test application
  Expect response: "response-code-8UnKuVzEwx"
  </code></pre>
  
  <p>and while connecting to test application it showed :</p>
  
  <pre><code>Received incorrect response: "Error: Failed to write /home/***/.amp/canary/data/FivN1DBNa4c05mUoshFCNDn2dHMDc01I/example.txt
  Error: Failed to remove /home/***/.amp/canary/data/FivN1DBNa4c05mUoshFCNDn2dHMDc01I/example.txt"
  </code></pre>
  
  <p>I have followed the commands given here : <a href="https://buildkit.civicrm.org/#/tutorials" rel="nofollow">https://buildkit.civicrm.org/#/tutorials</a>.</p>
  
  <p>And restarted the server many times. </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-09T19:52:52.893Z
Comments.Text: Try this? http://civicrm.stackexchange.com/questions/10219/buildkit-amp-test-fails-incorrect-response-received
Comments.UserDisplayName: Dilip Raj Baral
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-03-09T21:24:03.933Z
Comments.Text: Hi, tried this already. Still showing the same error. Any more help would be appreciated. :)
Comments.UserDisplayName: Anjali Ujjainia
Tags: <civicrm-buildkit>
Title: Buildkit - amp test recieved incorrect response while connecting to a test application
ThreadText: # Buildkit - amp test recieved incorrect response while connecting to a test application
  
  (Asked by: username_0 on 2016-03-09)
  
  I had successfully ran the buildkit till got this error while running amp test. It created the test application, created data directory, set up few ports 
  Create data directory:/home/***/.amp/canary/data/FivN1DBNa4c05mUoshFCNDn2dHMDc01I
  AMP_URL='http://localhost:7979'
  AMP_ROOT='/home/***/.amp/canary'
  AMP_DB_DSN='mysql://canary_zcz0m:AfLQGc9SAf9Y8zno@127.0.0.1:3306/canary_zcz0m?new_link=true'
  AMP_DB_USER='canary_zcz0m'
  AMP_DB_PASS='AfLQGc9SAf9Y8zno'
  AMP_DB_HOST='127.0.0.1'
  AMP_DB_PORT='3306'
  AMP_DB_NAME='canary_zcz0m'
  AMP_DB_ARGS='-h 127.0.0.1 -u canary_zcz0m -pAfLQGc9SAf9Y8zno -P 3306 canary_zcz0m'
  
  Connect to test application
  Expect response: "response-code-8UnKuVzEwx"
  
  and while connecting to test application it showed :
  Received incorrect response: "Error: Failed to write /home/***/.amp/canary/data/FivN1DBNa4c05mUoshFCNDn2dHMDc01I/example.txt
  Error: Failed to remove /home/***/.amp/canary/data/FivN1DBNa4c05mUoshFCNDn2dHMDc01I/example.txt"
  
  I have followed the commands given here : https://buildkit.civicrm.org/#/tutorials.
  And restarted the server many times.
  
  **Tags:** civicrm-buildkit
  
  > **Comments:**
  > **username_1**: Try this? http://civicrm.stackexchange.com/questions/10219/buildkit-amp-test-fails-incorrect-response-received  
  > **username_0**: Hi, tried this already. Still showing the same error. Any more help would be appreciated. :)  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2019-09-10. Score: 1
  
  I encountered the same error, setting up buildkit and then running `amp config` and `amp test` on Ubuntu 19.04.
  
  What I figured out was that I too had initially chosen 0 for `perm_type` when running `amp config`.
  
  I changed the `perm_type` value to `linuxAcl` and chose `www-data` as the web user.
  
  Using those values then allowed me to successfully run `amp test`.
  
  
  ---
  
  ### Answer by username_0 on 2016-04-19. Score: 1
  
  The error was due to the permission issue but I used another method for solving this.
  At the time of amp config I chose [1] for the option perm\_type, which sets the appropriate permissions according to linux.
  
  Option: perm\_type
  Description: How to set permissions on data directories [none,custom,linuxAcl,osxAcl,worldWritable]. See <https://github.com/totten/amp/blob/master/doc/perm.md>
  
  Default: none
  
  Enter perm\_type
  
  1. [0] "none": Do not set any special permissions for the web user
  2. [1] "linuxAcl": Set tight, inheritable permissions with Linux ACLs
     [setfacl] (recommended)
     In some distros+filesystems, this requires extra configuration.
     eg For Debian-based distros: <https://help.ubuntu.com/community/FilePermissionsACLs>
  3. [2]"osxAcl": Set tight, inheritable permissions with OS X ACLs [chmod
     +a] (recommended)
  4. [3] "custom": Set permissions with a custom command
  5. [4] "worldWritable": Set loose, generic permissions [chmod
     1777] (discouraged)
  
  
  ---
  
  ### Answer by username_3 on 2016-04-15. Score: 0
  
  This might be due to permission issues, so as you mentioned that you followed civicrm-buldkit tutorials, now assuming that your buildkit is installed in /opt/buildkit directory I would suggest to change the permission of this directory by running the following code :
  sudo chmod -R 777 /opt/buildkit
  
  This command will recursively change the permission of the directory and enable all other users to create/modify/delete files and directories in it. But it is not advisable to do a 777 because of security reasons. If you are really concern about security then please look into changing the ownership of the files/directory or may be do a 755 instead with suitable arguments.
  Hope it helps.
  
  
  ---
  
  