{"id":1631,"date":"2022-08-30T15:18:08","date_gmt":"2022-08-30T15:18:08","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/27\/symfony-no-field-or-association-only-happening-when-i-use-capifony-for-deployment-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:18:08","modified_gmt":"2022-08-30T15:18:08","slug":"symfony-no-field-or-association-only-happening-when-i-use-capifony-for-deployment-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/symfony-no-field-or-association-only-happening-when-i-use-capifony-for-deployment-collection-of-common-programming-errors\/","title":{"rendered":"Symfony &ldquo;No field or association&rdquo;, only happening when i use capifony for deployment-Collection of common programming errors"},"content":{"rendered":"<p>I have been struggling for the past few days with capifony, every time when i deploy it seems to be throwing the following error:<\/p>\n<pre><code>[2012-12-26 15:09:57] request.CRITICAL: Doctrine\\ORM\\Query\\QueryException: [Semantical Error] line 0, col 111 near 'user = u.id WHERE': Error: Class MyName\\MyBundle\\Entity\\Uservote has no field or association named user (uncaught exception) at \/home\/**user***\/public_html\/****\/shared\/vendor\/doctrine\/orm\/lib\/Doctrine\/ORM\/Query\/QueryException.php line 49 [] []\n<\/code><\/pre>\n<p>however everything is working perfectly on localhost and it also works when i zip the entire folder and manually copy it to the server (not a good way of deploying a symfony app)<\/p>\n<p>This error occurs with capifony<\/p>\n<p>my deploy.rb<\/p>\n<pre><code>set :application, \"****\"\nset :domain,      \"***.hostgator.com\"\nset :deploy_to,   \"\/home\/***\/public_html\/test.***.org\/\"\n\nset :app_path,    \"app\"\nset :web_path,    \"web\"\nset :user,        \"*****\"\nset :port,        \"2222\"\nset :use_sudo,    false\nset :php_bin, \"\/opt\/php53\/bin\/php\"\nset :assets_install, false\ndefault_run_options[:pty] = true\n\n#SYMFONY 2 SPECIFIC\nset :shared_files,      [\"app\/config\/parameters.yml\"]\nset :shared_children,   [app_path + \"\/logs\", web_path + \"\/uploads\", \"vendor\"]\nset :use_composer, true\nset :update_vendors, true\nset :cache_warmup, true\nset :repository,  \"git@bitbucket.org\/****\/***.git\"\nset :scm,         :git\n# Or: `accurev`, `bzr`, `cvs`, `darcs`, `subversion`, `mercurial`, `perforce`, or `none`\nset :vendors_mode,          \"install\"\nset :model_manager, \"doctrine\"\n# Or: `propel`\n\nrole :web,        domain                         # Your HTTP server, Apache\/etc\nrole :app,        domain                         # This may be the same as your `Web` server\nrole :db,         domain, :primary =&gt; true       # This is where Symfony2 migrations will run\n\nset  :keep_releases,  3\n# IMPORTANT = 0\n# INFO      = 1\n# DEBUG     = 2\n# TRACE     = 3\n# MAX_LEVEL = 3\nlogger.level = Logger::MAX_LEVEL\n\n# Be more verbose by uncommenting the following line\n# logger.level = Logger::MAX_LEVEL\n\n\n#SPEED UP DEPLOY\n# Symfony2 2.1\n#before 'symfony:composer:update', 'symfony:copy_vendors'\n\nnamespace :symfony do\n  desc \"Copy vendors from previous release\"\n  task :copy_vendors, :except =&gt; { :no_release =&gt; true } do\n    if Capistrano::CLI.ui.agree(\"Do you want to copy last release vendor dir then do composer install ?: (y\/N)\")\n     capifony_pretty_print \"--&gt; Copying vendors from previous release\"\n     run \"cp -a #{previous_release}\/vendor #{latest_release}\/\"\n     capifony_puts_ok\n   end\n end\nend\n\n# Fix persmissions on VPS\n\nafter \"deploy:update_code\" do\n  namespace :symfony do\n    capifony_pretty_print \"--&gt; Fixing permissions\"\n    run \"cd #{latest_release} &amp;&amp; find . -type f -exec chmod 644 {} \\\\;\"\n    run \"cd #{latest_release} &amp;&amp; find . -type d -exec chmod 755 {} \\\\;\"\n    capifony_puts_ok\n  end\nend\n\nafter \"deploy\", \"deploy:cleanup\"\n<\/code><\/pre>\n<p>I am pretty sure that my Useraccounts entity is correct, but to be sure here it is<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-27 12:10:03. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I have been struggling for the past few days with capifony, every time when i deploy it seems to be throwing the following error: [2012-12-26 15:09:57] request.CRITICAL: Doctrine\\ORM\\Query\\QueryException: [Semantical Error] line 0, col 111 near &#8216;user = u.id WHERE&#8217;: Error: Class MyName\\MyBundle\\Entity\\Uservote has no field or association named user (uncaught exception) at \/home\/**user***\/public_html\/****\/shared\/vendor\/doctrine\/orm\/lib\/Doctrine\/ORM\/Query\/QueryException.php line 49 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,1],"tags":[],"class_list":["post-1631","post","type-post","status-publish","format-standard","hentry","category-semantic","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1631"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1631\/revisions"}],"predecessor-version":[{"id":8808,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1631\/revisions\/8808"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}