When I log in on my dev machine in an ROR application, I should be redirected to http://sitename/user/dashboard. This was happening successfully before, till I began developing on it :). Now it tries to go to http://sitename/user/images/navarrow, which results in the error ActionController::UnknownAction (No action responded to images).
I hadnt changed anything in the code except layout,views-level changes, no actions etc were changed. Then I reverted to a previous version to check, and it worked fine. I reverted back to my latest version and it again worked fine. So the problem doesnt seem to be in code, but somewhere else. I want to know why exactly this problem crops up every now and then. The fix is not hard, i just have to revert to a previous commit and then come back to latest commit, but I cannot figure out how it tries to redirect to a wrong url in the first place. Do I need to change some configuration to make it not happen again?
UPDATE: I had to work on the UI of the login form as well. Now when I created a login form with the required css, and tried to submit, this is what i get:
Parameters: {"format"=>"jpg", "action"=>"images", "id"=>"galway", "controller"=>"user"}
ActionController::UnknownAction (No action responded to images):
As you can see, I get another different faulty url, the prvious one had :id=>'navarrow'. SO I get the same error as above of a faulty url creeping out of nowhere! But wehn i go back and refresh, i discover that i actually am logged in, so the new login form is working as expected. i think if i commit my code now, and then go thru th process again, it will work again, but this bug is driving me crazy!
I think i figured it out partially. In the page, there were two images, entered like so:
<img src="images/nav_arrow.jpg".../>
<img src="images/galway.jpg".../>
So for some reason when a form got posted, and we were redirected to another page, somehow it also tried to map its request to controller/images/nav_arrow.jpg etc, and this was causing the unexpected behavior. But I still have to figure out why this error does not always crop up. I change image paths to absolute ones to make it work!
I'd check that you don't have something sneaking in .htaccess files to your directories (maybe one got accidentally checked in)?
Related
Let me say first that I'm quite new and inexperienced with rails. Today I tried to update an image in a rails app hosted on Heroku. Anyway, this is the simple flow I followed as I did other times before:
Add updated image to the image folder
Precompile the assets rake assets:precompile
Add and commit all changes
Push to heroku
Until this point all seems fine: I open Chrome to check my app from my domain and it's all there as expected.
The problem is that if I refresh the page all the images disappear (like they have never been loaded). This does not happen locally.
If I do a ctrl+f5 it all comes back nicely, but I lose everything again on simple refresh.. and so on.
Has anyone experienced something similar? I understand this might be hard to answer as there is not much code to show. Let me know if I can give more details.
On a final note, it seems that all works normally on a friends machine (that is, refresh doesn't give this problem). I'm thinking something might be wrong with my Chrome settings here? I don't remember having changed anything recently though.
This is very weird and quite annoying some help/insights would be great.
UPDATE: This seems indeed really to happen locally on my machine at work. I checked from another couple of computers at home and the app is displayed fine (without any refreshing problem).
Did you check if the cookie is disabled by your browser for the heroku website in particular?
I have just tested this issue with an image based website (https://unsplash.com/). When the cookie is disabled for that website, pressing F5 clears all the images, while pressing Ctrl-F5 brings those lost resources back as like as your case.
Enabling cookie resolves the issue in my case.
So I install Ghost CMS and it is working great, but I noticed recently that the navigation settings (where I add new links to the menu and such) are acting strange and not working right.
So in the image above you will notice the ':80' port being added onto the domain. Which is fine I guess, but what is odd is that if i click out the field and then back into it it adds another port ':80' and continues to do that as many times as I click out, also if I tried to delete and save it immediately adds them back in. Look at Teaching and you will see what it ends up looking like.
Also when I go to the site front page and click one of the menu items I see a 404 error in the console saying the page doesn't exists.
I can't figure out what is going on it was working just fine a few weeks ago and I have touched anything on the server. I am stumped, I don't really know enough about Ghost so I am relying on a better expert to help me out here. I am using the Bitnami Ghost Cloud Image. and have the theme bleak installed.
Any Thoughts?
We have never experienced this issue in Umbraco 4, but we've got this twice in Umbraco 7.
The Problem
So we've got a page: www.mywebsite.com/sale
It has been working for a month, then suddenly it shows 404:
The (non-ideal) Solution
We could change the template of this document, eg. from SalePage to TextPage, then back to SalePage.
That will temporarily fix it.
But after IIS restart, or after republishing the page, it will show the 404 error again.
For a permanent fix, we have to change the page name, eg. from Sale to Sale1.
The Question
Sometimes changing the page name is not an ideal solution at all.
Has anyone experienced this? Or know where to look? May be the database has a corrupted entry somewhere..?
We found the problem! We have this structure under Content:
Home
HomeSlide1
HomeSlide2
Pages
Sale
About Us
etc
The problem started when someone created a "home slide" under Home called "sale".
So, both Home/sale and Pages/Sale has the same path: /sale/
Deleting/renaming Home/sale fixed the problem.
This sounds like a corrupt cache.
To find out what went wrong:
Investigate the xml config (/config/umbraco.config)? I suspect this file will still contain the correct information.
If the umbraco.config file doesn't contain wrong elements, check the examine indexes. When you do a "rebuild indexes" from the developer node in the umbraco backend the problem might go away also.
If you know what is going wrong, you can start finding a solution for fixing the issue. E.g. finding out which action went wrong.
I am having a strange issue with my Grails application. It seems that it's caching the views incorrectly. What is happening, is that the first time I hit a path with a specific action (let's say /controller/index) it will load the correct index view for that controller. Now, when I go to /anotherController/index, the correct controller is called, but it still tried to serve the old index gsp, resulting in obvious *NotFound exceptions.
This happens with all views. The first one that get's loaded gets displayed for all subsequent actions with the same name. I.e. the first show that get's called will be correct, but then any other show for another domain object tries to use the old one.
Any suggestions? My code is pretty much the stock standard generate-all versions at the moment.
I should also say, running in dev mode works 100%. Prod war in tomcat 7.0.42 is giving the issues.
I had a weird issue like this a few weeks ago, but it was caching some information from the database and was not returning the correct results.
Here is what I did:
Stopped Tomcat
Deleted all the files in Tomcat's Temp directory
Restarted Tomcat
After that, it worked fine.
Let me know if this helps.
A website of mine is behaving weirdly. The layout sometimes is fine, and sometimes it is screwy. An example page that I see the problem on is this one: link
Disclaimer: I have yet to start my investigation into cause in earnest. I am turning to Stackoverflow because I am lazy and I hope someone will say "That happened to me once, it is probably this...". So please, no one get stuck into this working out this issue if it is something you have never seen before, as it wouldn't be fair as I have not done it myself.
Ok, some background:
The problem usually (maybe always) occurs when first viewing the page
The problem does not show up always, only sometimes
When the page shows up munged, if you refresh it usually reloads looking as it should
The site is a rails app
The css is passed through the neat Smurf Gem, which automatically minifies the CSS and Javascript on the page.
The layout problems happen in firefox (both linux and winXP)
The CSS is served up in the production environment using the ":cache => true" option which concatenates all the css files into one file
Anyway, I am hoping that this has happened to someone before and it will be really simple to fix. If not, I'll go and investigate and return with the solution (or a request for more help).
Thanks in advance!
James.
[edit]I added the first two bullet points, inspired by the comments and first answer[/edit]
We have had something similar when using HAML and SASS that resulted in the CSS being completely unavailable. It only happened on deploys. We determined it was a combination of the Rails stylesheet merging and the generation of the CSS from SASS. Sass was not done generating the CSS, which it did so on the first request to the application, when Rails attempted to merge it all together. The result, a corrupt useless CSS file. Then we stumbled upon this article which has a solution for preventing this issue.
Based on all this, my best guess is that the Smurf gem is attempting to generate your file on the first request, but Rails is serving it out before its done. The generation completes then each following request is fine. If this is the problem then the only solution i know of is to get the file generated before the first request. Of course, this does assume that it is related to deployments or application restarts in some way.
Peer
I had such a problem. The problem was only at the first time the page was loaded. Just reload it and it was fine.
The problem in my case was that the images where not there in the cache for the first time so the browser didnt know it's dimensions when preparing the page which caused the problem
If an image doesn't have a height/width assigned to it, a place is created on the page and it's put there. If the image doesn't quite fit, the browser may not know this until it's refreshed. Then it already knows the size and can properly fit it onto the page.