'Failed to load resource' after adding new controller - asp.net-core-webapi

I have already added 2 controllers in my Web API, StudentsController and AuthenticateController, and and everything is working as it should. When I go to http://localhost:64792/api/students, it prints the default: ["value1","value2"]
The problem is when I add a third controller, nothing works anymore. When i go to the same URL, I get the following error:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
Are you limited to 2 controllers only, or what am I missing here?

Related

Angular 2 always returns http status code 200 on this.http.get() even if the file doesn't exist

i'm trying to check if a pdf file exists on the server with an HTTP get request,for that i am testing if the status code returned by the server's response is different then 200, the problem is that i always get status code 200 and statusText "OK".
here's my Service class
getPdf(year: number,type: number, num: number): boolean{
this.http.get('http://localhost:4200/app/pdfs/'+year+'/'+type+'/'+num+'.pdf')
.subscribe(data => console.log(data));
return true;
}
in my component i have this code :
ngOnInit(){
this.pdfService.getPdf(2016,71015,1275);
}
and that's the result i get in Chrome dev tools console
any ideas of why that is happening and how i can check the existance of a file if this method is not applicable?
I think your server is redirecting some or all requests for assets not found to your main page. It is somewhat common for a single page app. You need to update your server configurations to make it return a not found response for some folders at least.

Internal Server Error in OAuth for Google

EDIT: I was able to resolve the original error here when I realized my ROOT URL was set to my IP address rather than my domain. However, I now have a new issue. My client ID is the same as the original post below. This works fine in the local app, but in production, the popup flashes for a second and then the login box displays "Internal Server Error". I can't see any other messages that would explain it.
I am using the service-configuration package to load the settings, as follows:
ServiceConfiguration.configurations.upsert(
{ service: "google" },
{
$set: {
clientId: "************",
loginStyle: "popup",
secret: "***********"
}
}
);
If I add ?close to the end of my Authorized redirect URI, the Google popup comes up with a redirect_uri_mismatch error, showing the URI without ?close. I think there was an issue resolved here but it at least shows me that my project in Google is being recognized.
ORIGINAL POST
I am setting up an OAuth 2.0 client ID for accounts-google in Meteor and am seeing the following error:
400. That’s an error.
Error: invalid_request
Invalid parameter value for redirect_uri: Raw IP addresses not allowed:
http://***.***.***.***/_oauth/google
My Client ID in Google:
Authorized Javascript Origins
http://localhost:3000
http://myApp.com
Authorized redirect URIs
http://localhost:3000/_oauth/google
http://myApp.com/_oauth/google
I understand I must not be properly pointing the domain to the IP address. I have already set up an A record and the site works fine in other regards though, so not sure what step I missed.

reCaptcha validation with timeout exception

I am using reCaptch in my MVC 3 web app running in the localhost.
Things were working fine few weeks back but suddenly failing.
Suddenly getting this error.
if(!ReCaptcha.Validate(_config.RecaptchaPrivateKey)){ <-- times out here
//process other fields in the form
}
As soon as I fill the form and hot submit I get this error :
The operation has timed out
Description : An unhandled exception occurred during the execution of the current ...
Exception Details : System.Net.WebException: The operation has timed out
Is this a proxy issue?
Is this because my site on localhost runs on port 3316?
localhost:3316/user/signup
I saw some posts that suggests that reCAPTCHA expects port 80 but my app runs on port 3316
What can be the issue?
Thanks
I got around this by creating proxy class that inherits IWebProxy.
Then specifying to use this proxy when internal, I had to transform it out for other environments that didn't need to use it.
See this question and accepted answer:
Is it possible to specify proxy credentials in your web.config?
The above link took some finding, so I favourited it for future use.

Oops! An Error Occurred The server returned a "500 Internal Server Error" on new actions created

I get the error as soon as I enter one of my actions on the project.
Oops! An Error Occurred The server returned a "500 Internal Server Error". Something is broken
Only on 1 page (Action) it happens. The most recent Action I created. The strange thing is that this happens only on the server. Locally on my windows server the page works normally.
The PHP internal logs on the server returns no errors.
The error occurs even if I remove all the code in the action and even if I clear the cache with 'php symfony cc'. Even if I set the permissions with 'php symfony project:permissions'. Even if I combine all of the previous solutions in different order.
Here is the action code:
public function executeExportPostsToProject(sfWebRequest $request)
{
echo 'why?? Show me please!';
}
On the same module there are about 20 other actions decleared the same way. I'm going crazy.
Tryed to check my server configuration for symfony. No Warnings.
The symfony version is 1.4.5.
Seems that the file name of the View is case sensitive under Linux. On Windows hadn't the same problem. On Linux for some reasons with the new files created on windows the problem occured. I renamed the View from exportPostsToProject.php to ExportPostsToProject.php solved this problem.
add route like this in your routing.yml for this action:
route_name:
url: /route-name-example
param: { module: ModuleName, action: exportPostsToProject }
and make sure to be on DEV environment

Drupal CMIS Alfresco-link issue

I am getting the following error when I try to update or add contents to alfresco via drupal.
Notice: Undefined index: workspace://SpacesStore/2e3ea968-07ec-48c8-8295-80bfbef554d6 in CMISService->getLink() (line 421 of /home/drupal/myra/sites/all/modules/contrib/cmis/cmis_common/lib/cmis_repository_wrapper.php).
HTTP call to [http://myra-dev-repo.bmi.utah.edu:80/alfresco/service/cmis/s/workspace:SpacesStore/i/2e3ea968-07ec-48c8-8295-80bfbef554d6/content] returned [500]. Response: Web Script Status 500 - Internal Error Web Script Status 500 - Internal Error The Web Script /alfresco/service/cmis/s/workspace:SpacesStore/i/2e3ea968-07ec-48c8-8295-80bfbef554d6/content has responded with a status of 500 - Internal Error. 500 Description: An error inside the HTTP server which prevented it from fulfilling the request. Message:11212017 Failed to execute transaction-level behaviour
I understand that the problem is with the getLink() method which is returning an index of the workspace where the data needs to be saved.But I am unable to figure out where the change has to be made.Moreover this is a new error that has popped up recently.I remember not changing/updating anything : - ( drupal or alfresco setup) that was working just fine.
Please let me know what is going wrong.Thanks.
This problem arises only if the permissions are messed up within the server.So proper attention needs to be paid to, when the content is edited/added/modified etc

Resources