Hi there. I just received the following error on my restaurant's drupal-based website:

" * One or more problems were detected with your Drupal installation. Check the status report for more information.
* user warning: Can't create/write to file 'c:\windows\temp\#sql_a4c_0.MYD' (Errcode: 17) query: SELECT DISTINCT b.* FROM blocks b LEFT JOIN blocks_roles r ON b.module = r.module AND b.delta = r.delta WHERE b.theme = 'giordani' AND b.status = 1 AND (r.rid IN (2) OR r.rid IS NULL) ORDER BY b.region, b.weight, b.module in C:\www\brotherstwo.ca\htdocs\modules\block\block.module on line 407.

Any ideas???? Kind of an emergency! Thanks so much for any help!
Justin

Comments

fractile81’s picture

Category: bug » support

You appear to be having a problem with MySQL, not Drupal. MySQL is saying it cannot write to that directory. Are you able to query the MySQL server directly (e.g. PHPMyAdmin, or MySQL Query Browser)?

Have you tried restarting your MySQL service?

ainigma32’s picture

Status: Active » Postponed (maintainer needs more info)

Error 17 means that MySQL is trying to create a temporary file that already exists.
So stop the MySQL service. Remove the contents from c:\windows\temp (some items may be in use, just skip those)
Start the MySQL service and you should be good to go.

Please post back your findings.

- Arie

ainigma32’s picture

Status: Postponed (maintainer needs more info) » Fixed

Looks like jadoiron won't be posting any feedback so I'm setting this to fixed.

Feel free to reopen if you think that is wrong.

- Arie

Ether’s picture

Status: Fixed » Active

It's not fixed. I understand that this is MySQL error. But how to solve it ?
My temp folder excluded from antivirus scanning, permision is set to full access for everybody, including system. And what I get is
user warning: Can't create/write to file 'W:\WEB\Temp\#sql_1304_0.MYD' (Errcode: 17) query: SELECT t.* FROM term_node r INNER JOIN term_data t ON r.tid = t.tid INNER JOIN vocabulary v ON t.vid = v.vid WHERE r.vid = 170 ORDER BY v.weight, t.weight, t.name in W:\WEB\htdocs\modules\taxonomy\taxonomy.module on line 618.

After that only restart of MySQL server helps.
Any suggestions ?

ainigma32’s picture

Title: Sudden Error » MySQL error 17: Can't create/write to file
Component: block.module » database system
Status: Active » Postponed (maintainer needs more info)

You could try creating a temp directory especially for MySQL and pointing to it in my.ini
Also exclude that directory from the virusscanner to avoid locking and make sure MySQL has sufficient permissions.

Please post back how that works for you.

- Arie

Ether’s picture

Thanks ainigma32.
Only Drupal using W:/Web/Temp folder, and, as I wrote before, it is excluded from virus scan. And it present in my.ini as tmpdir=W:/web/temp

Added.
Now I have increased InnoDB log file size (from 27 M to 256 M). Looks better. No errors yet. Will see what will happend after weekend.

Ether’s picture

So, looks like this problem solved, FOR ME. No more Can't create/write errors.

ainigma32’s picture

Status: Postponed (maintainer needs more info) » Fixed

Good to hear.

- Arie

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Ether’s picture

Status: Closed (fixed) » Active

Got it back.
Interesting that when this happening *.myd file's size always the same - 17872 bytes.

Ether’s picture

Status: Active » Closed (fixed)

The problem disappear when I fixed problem with cron.

Coldice4678’s picture

#11 @Ether, best fix. I had the same errors, tried messing with the mysql server. But it was simply I need to load cron.php (when moving servers I happen to forget to reset its hourly ping, so I guess it got backed up)

geshan’s picture

what is the best solution for this I'm also getting the same problem.

mattyoung’s picture

Version: 6.7 » 6.12
Status: Closed (fixed) » Active

I'm getting this error. The error message is:

user warning: Can't create/write to file '/tmp/#sql_3746_0.MYD' (Errcode: 17) query: SELECT t.* FROM term_node r INNER JOIN term_data t ON r.tid = t.tid INNER JOIN vocabulary v ON t.vid = v.vid WHERE r.vid = 128 ORDER BY v.weight, t.weight, t.name in /var/www/html/drupal/modules/taxonomy/taxonomy.module on line 617.

At first even issuing a 'describe' command in mysql would come back with the same "Can't create/write to file '/tmp/#sql_3746_0.MYD' (Errcode: 17)."

For example, I do this in mysql:

use mysql;
describe db;

and I get this error. Then I run this in mysql:

flush tables;

Now mysql is okay, I can do the 'describe'. I can even run the same failed query from the Drupal error message. I just type the exact same query (switching to the right database first). But browsing my site still show the same error.

I would think once the query can run in mysql, the Drupal should be okay. But drupal continue to have the error.

I have seen this error several times now. Sometime the file '/tmp/#sql_3746_0.MYD' is there. Sometime that file is not.

The problem clear up after I run cron.php.

I'm running on a Linux host. There should be file permission to the /tmp dir.

dpearcefl’s picture

Status: Active » Closed (fixed)

Please don't hijack an issue. Open you own issue.