Why the pinging process doesn't stop after playbook is finished? - iis

My playbook has to delete all files form the IIS sit folder, replace them with other files and then ping the localhost website. The pinging process doesn't seem to stop after playbook is finished. When I run playbook for the first time everything seems to work fine. But when I try to run it for the second time I get error while deleting files:
TASK [Delete files from site files ALL]
**************************************** fatal: [10.156.5.245]: FAILED! => {"changed": false, "msg": "Failed to delete
\file.dll: Access to the path '\file.dll' is
denied."}
name: Delete files from site files ALL
win_file:
path: {{ some path }}
state: absent
name: Ping the localhost website
win_uri:
url: http://localhost:48103/ping
run_once: true
Am I using win_uri wrong or is it some other issue?
After some thinking obout answer to my question I've come up with the idea of restarting the IIS App Pool in which I have my site. It's a workaround and I'm still loking for other answers :)

Please try with admin access using become.
- name: Delete files from site files ALL
win_file:
path: {{ some path }}
state: absent
become: yes

try to use the process monitor to capture the access denied exception.
download link.
after downloading extract the folder and open the process monitor application.
Process Monitor starts capturing events automatically. Stop capturing by clicking Capture button (CTRL + E) in the toolbar.
From the Filter menu, and click Filter.
In the Process Monitor Filter dialog, click the Reset button. This is to clear filters.
Then, set the filtering options as the one below, to catch specifically "Access Denied" entries.
Click Add, and click OK.
Start capturing by enabling the Capture toggle button in the toolbar.
reproduce the problem and check the process monitor entry.

Related

Chrome extension background script "Cannot access contens of URL devtools..." error?

I have a background script called events.js
I am occassionally getting this error
Unchecked runtime.lastError: Cannot access contents of url
"devtools://devtools/bundled/devtools_app.html?remoteBase=https://chrome-devtools-frontend.appspot.com/serve_file/#ed9d447d30203dc5069e540f05079e493fc1c132/&dockSide=undocked".
Extension manifest must request permission to access this host.
It is apparently being generated not by events.js but by "_generated_background_page.html" but appearing in my background console log.
I suspect it is being caused by my call in events.js to:
chrome.webNavigation.onHistoryStateUpdated.addListener(function(e) {
// do stuff
}
It is driving me nuts. Can anyone please tell me what is going on?
Similar issue happened to me today. One of those facepalm moments. I discovered as i had a breakpoint in my background script to check something before the content-script was executed in the handle message, that this background devtools tab became the active tab and tired to inject the script and not the intended tab from which I activated my extension.
Hence the error.
Cannot access contents of url
"devtools://devtools/bundled/devtools_app.html?remoteBase=https://chrome-devtools-frontend.appspot.com/serve_file/#7345a6d1bfcaff81162a957e9b7d52649fe2ac38/&dockSide=undocked".

Redirect Joomla errors on Windows Azure IIS

I have a Joomla! site running on Windows Azure and all is fine.
But, everytime someone try do access something that not exist (www.domain.com/xpto) the server returns the error:
jos-Warning: exception 'RuntimeException' with message 'Unknown column 'header' in 'field list' SQL=SELECT new_url,header,published FROM xxx_redirect_links WHERE old_url = 'http://www.domain.com/xpto' LIMIT 0, 1' in
How can I redirect the user to the index everytime an error occurs?
This is a bug in Joomla, try to fix this by:
Click on the Fix button in the Extension Manager -> Database page. If
that fails, a clean installation will need to be done.
ref: https://github.com/joomla/joomla-cms/issues/5953

Mac OS app entitlements block internet connection

I have a Mac OS app that needs outgoing connections.
I've followed Apple Code Signing Guide (Xcode 4.6.2) to enable entitlements and my target summary looks like this:
I have a MYAPP.entitlements file in my project that looks like:
Everything seems to be set in the right way, but when I try to run my app, even if
- (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame
and
- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
are called, nothing is loaded in my webView. Nor Little Snitch asks for connection.
Then, in Console no violation is presented.
If I try to change Entitlements setting, by unchecking "Allow Outgoing Connections", Console shows Sandbox violation this way:
20/05/13 00:44:09,000 kernel[0]: Sandbox: sandboxd(908) deny mach-lookup com.apple.coresymbolicationd
20/05/13 00:44:10,593 sandboxd[908]: ([904]) MYAPP(904) deny mach-lookup com.apple.SystemConfiguration.SCNetworkReachability
20/05/13 00:44:10,601 sandboxd[908]: ([904]) MYAPP(904) deny system-socket
If I remove Enable App Sandboxing, everything works and my webView loads its contents...
I have tried:
to exit Xcode
to reboot my computer
to boot in save mode
to enable any combination of permissions in Entitlements
to create a new MYAPP.entitlements file
to rename my target
Anybody has experienced this behavior?
Any suggestion will be very appreciated... Thank you.
Well, I ended up reinstalling my whole system and now it works...

TYPO3 Scheduler: The page is not configured! [type= 0][]

I have a problem with my scheduler in TYPO3 4.5.5. Every time a task is executed it fails with the following error message:
[scheduler]: Task failed to execute successfully. Class: tx_jobportal_apply, UID: 5. The page is not configured! [type= 0][]
There are 3 domains in my page tree, each having an own root template. The TypoScript Object Browser shows a setup with page.typeNum = 0
I don't know how I can comment on this, so I'll post it as an answer..
I'm guessing you are initiating the TSFE in the scheduler task. Did you specify a page-id, and if so, have you checked this page is under a specific root-page with a typoscript template that has a 'PAGE' configured?
It looks like Your extension jobportal sends an error, check manually the action You are trying to do with scheduler.
The problem is solved.
I made a file reference in the root template in which the PAGE object was configured, like this
<INCLUDE_TYPOSCRIPT: source="FILE: fileadmin/typoscript/template-setup_main.ts">
After configuring the object directly in the setup of the template no more error messages appeared and now I am a lucky guy ;)
#Koopa: Thanks for the hint!

System.Net.WebClient doesn't work with Windows Authentication

I am trying to use System.Net.WebClient in a WinForms application to upload a file to an IIS6 server which has Windows Authentication as
it only 'Authentication' method.
WebClient myWebClient = new WebClient();
myWebClient.Credentials = new System.Net.NetworkCredential(#"boxname\peter", "mypassword");
byte[] responseArray = myWebClient.UploadFile("http://localhost/upload.aspx", fileName);
I get a 'The remote server returned an error: (401) Unauthorized', actually it is a 401.2
Both client and IIS are on the same Windows Server 2003 Dev machine.
When I try to open the page in Firefox and enter the same correct credentials as in the code, the page comes up.
However when using IE8, I get the same 401.2 error.
Tried Chrome and Opera and they both work.
I have 'Enable Integrated Windows Authentication' enabled in the IE Internet options.
The Security Event Log has a Failure Audit:
Logon Failure:
Reason: An error occurred during logon
User Name: peter
Domain: boxname
Logon Type: 3
Logon Process: ÈùÄ
Authentication Package: NTLM
Workstation Name: boxname
Status code: 0xC000006D
Substatus code: 0x0
Caller User Name: -
Caller Domain: -
Caller Logon ID: -
Caller Process ID: -
Transited Services: -
Source Network Address: 127.0.0.1
Source Port: 1476
I used Process Monitor and Fiddler to investigate but to no avail.
Why would this work for 3rd party browsers but not with IE or System.Net.WebClient?
I have seen a similar issue, where the Integrated / NTLM security will only work if you are accessing the host by machine name or localhost. In fact, it is a [poorly] document feature in Windows that is designed to protect against "reflection attacks".
Basically, you need to create a registry key on the machine that is trying to access the server, and whitelist the domain you are trying to hit. Each host name / FQDN needs to be on it's own line - there are no wildcards and the name must match exactly. From the KB Article:
Click Start, click Run, type regedit, and then click OK.
In Registry Editor, locate and then click the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
Right-click MSV1_0, point to New, and then click Multi-String Value.
Type BackConnectionHostNames, and then press ENTER.
Right-click BackConnectionHostNames, and then click Modify.
In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK.
Exit Registry Editor, and then restart the computer.
http://support.microsoft.com/kb/956158/en-us
Have you tried ...
new NetworkCredential( "peter", "password", "boxname" );
You might also try ...
var credCache = new CredentialCache();
credCache.Add( new Uri ("http://localhost/upload.aspx"),
"Negotiate",
new NetworkCredential("peter", "password", "boxname"));
wc.Credentials = credCache;
Also, according to this it may be that IIS is configured wrong. Try replacing "Negotiate" with "Basic" in the above and checking your IIS config for the website. There's also a bunch of possible causes here.
Try going into IE's options and explicitly add the site to the Intranet Zone. Then re-run the program. You should also not run the program from an administrator login. This may trigger the Enhanced Security Configuration for Internet Explorer.
It could explain why you can hit the site with Firefox and Opera, but not with IE or WebClient.
Without knowing your IIS deployment, and assuming that you have the correct authorization rules for upload set in IIS (e.g. the right allow* ACL's on the right dirs you are trying to upload content to, etc), first thing I would try is to set UseDefaultCredentials to true instead of explicitly set Credential. (Maybe you think you are accessing the server with the Credentials you are setting but that's not the case? That would be possible if this works.)
This is a very common scenario, so I would focus on IIS authorization rules for the directory in which you are trying to upload the file, the actual ACL's on that directory. For ex. is your site impersonating or not? if it is, then you have to have actual ACL's on that dir, otherwise whatever account app pool is running on.

Resources