Answers.Body: <p>So I am going to answer my own question here: The solution was that something, I don't know what, what messed up in the DB. So I dropped the DB and then copied it over again from the original. That fixed it.  I never got an indication in the logs that the DB was the issue I just decided to start with replacing it and then work backward if necessary. </p>
  
  <p>Thanks for the tips. At least it eliminated the obvious issues.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-02T23:06:11.500Z
Answers.LastActivityDate: 2019-12-02T23:06:11.500Z
Answers.UserDisplayName: Pete Helgren
Body: <p>I needed to create a second instance of a craft 2.0 instance and so I copied the current instance to a new instance. I followed the directions found here: <a href="https://craftcms.com/guides/duplicating-a-craft-site" rel="nofollow noreferrer">https://craftcms.com/guides/duplicating-a-craft-site</a></p>
  
  <p>The structure is like this:</p>
  
  <p>/var/www/html/my_site (original - contains the craft and public folders)</p>
  
  <p>copied to:</p>
  
  <p>/var/www/html/new_folder/my_site (this contains the craft and public folders)</p>
  
  <p>There is a reverse proxy (Apache) that handles routing of the URL's.  The website comes up with no problems.  But, I cannot sign into the site to administer the site.  All I see is "An unknown error occurred."  There is nothing in the craft.log in the instance that indicates what the unknown error is.</p>
  
  <p>Is there a value in the database tables that might be incorrect?  I have scanned for references to the original path and I don't find anything.  The document root in the Apache config files for the instance is correct.  There was a recommendation to delete the runtime folder after copying a Craft install and I have done that but I still get the error and there are no errors in the craft.log file.</p>
  
  <p>One last interesting observation.  When I try the admin URL for the copied site e.g. <a href="http://copy.mysite.com/admin" rel="nofollow noreferrer">http://copy.mysite.com/admin</a> the login page for the original site is  displayed e.g <a href="http://orig.mysite.com/admin/login" rel="nofollow noreferrer">http://orig.mysite.com/admin/login</a>.  So, somewhere there is a reference lurking to the old site I copied.  I have changed general.php, db.php and search for references to the old host name but found nothing.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-29T13:03:17.917Z
Comments.Text: Have you cleared the storage / cache from the copied instance? You may still have some cached data pointing to the original instance.
Comments.UserDisplayName: Campiotti
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-29T19:31:54.837Z
Comments.Text: Check the `craft/storage/runtime/logs` folder for the underlying message for the "Unknown error occurred" flash.  There might be something in there that helps.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-02T19:23:33.730Z
Comments.Text: Cleared everything under the storage folder.  What I see in the console is: `Access to XMLHttpRequest at 'https://orig.mysite.com/index.php?p=admin/actions/users/login' from origin 'https://copy.mysite.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.`
  
  I changed the general.php file to point to copy.mysite.com so why does the login page still reference orig.mysite.com?  Where is that URL coming from?
Comments.UserDisplayName: Pete Helgren
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-12-02T21:22:28.113Z
Comments.Text: And, also see this in logs:
  
  `2019/12/02 21:14:00 [error] [exception.Craft\HttpException.503] exception 'Craft\HttpException' in /var/www/html/copy/craft/app/etc/web/WebApp.php:972
  Stack trace:
  #0 /var/www/html/copy/craft/app/etc/web/WebApp.php(263): Craft\WebApp->_processUpdateLogic()
  #1 /var/www/html/copy/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
  #2 /var/www/html/copy/craft/app/index.php(73): CApplication->run()
  #3 /var/www/html/copy/public/index.php(19): require_once('/var/www/html/c...')
  #4 {main}
  REQUEST_URI=/
  ---`
Comments.UserDisplayName: Pete Helgren
Tags: <craft2>
Title: Copy of Craft instance generates "An unknown error occurred" for login
ThreadText: # Copy of Craft instance generates "An unknown error occurred" for login
  
  (Asked by: username_0 on 2019-11-25)
  
  I needed to create a second instance of a craft 2.0 instance and so I copied the current instance to a new instance. I followed the directions found here: <https://craftcms.com/guides/duplicating-a-craft-site>
  
  The structure is like this:
  
  /var/www/html/my\_site (original - contains the craft and public folders)
  
  copied to:
  
  /var/www/html/new\_folder/my\_site (this contains the craft and public folders)
  
  There is a reverse proxy (Apache) that handles routing of the URL's. The website comes up with no problems. But, I cannot sign into the site to administer the site. All I see is "An unknown error occurred." There is nothing in the craft.log in the instance that indicates what the unknown error is.
  
  Is there a value in the database tables that might be incorrect? I have scanned for references to the original path and I don't find anything. The document root in the Apache config files for the instance is correct. There was a recommendation to delete the runtime folder after copying a Craft install and I have done that but I still get the error and there are no errors in the craft.log file.
  
  One last interesting observation. When I try the admin URL for the copied site e.g. <http://copy.mysite.com/admin> the login page for the original site is displayed e.g <http://orig.mysite.com/admin/login>. So, somewhere there is a reference lurking to the old site I copied. I have changed general.php, db.php and search for references to the old host name but found nothing.
  
  **Tags:** craft2
  
  > **Comments:**
  > **username_1**: Have you cleared the storage / cache from the copied instance? You may still have some cached data pointing to the original instance.  
  > **username_2**: Check the `craft/storage/runtime/logs` folder for the underlying message for the "Unknown error occurred" flash.  There might be something in there that helps.  
  > **username_0**: Cleared everything under the storage folder.  What I see in the console is: `Access to XMLHttpRequest at 'https://orig.mysite.com/index.php?p=admin/actions/users/login' from origin 'https://copy.mysite.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.`  I changed the general.php file to point to copy.mysite.com so why does the login page still reference orig.mysite.com?  Where is that URL coming from?  
  > **username_0**: And, also see this in logs:  `2019/12/02 21:14:00 [error] [exception.Craft\HttpException.503] exception 'Craft\HttpException' in /var/www/html/copy/craft/app/etc/web/WebApp.php:972 Stack trace: #0 /var/www/html/copy/craft/app/etc/web/WebApp.php(263): Craft\WebApp->_processUpdateLogic() #1 /var/www/html/copy/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest() #2 /var/www/html/copy/craft/app/index.php(73): CApplication->run() #3 /var/www/html/copy/public/index.php(19): require_once('/var/www/html/c...') #4 {main} REQUEST_URI=/ ---`  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-12-02. Score: 1
  
  So I am going to answer my own question here: The solution was that something, I don't know what, what messed up in the DB. So I dropped the DB and then copied it over again from the original. That fixed it. I never got an indication in the logs that the DB was the issue I just decided to start with replacing it and then work backward if necessary.
  
  Thanks for the tips. At least it eliminated the obvious issues.
  
  
  ---
  
  