Developer forum

Forum » Swift » Swift styles are lost sometimes

Swift styles are lost sometimes

Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi,

 

I have a challenge.

  • I have a Swift site in 1.12.0 and in a webfarm with 8 nodes (DW 9.14.10)
  • Almost daily the Swift_styles_{AreaId}.min.css files gets broken and we need to make a simple change before rendering the Branding/Themes page to have it be regenerated

 

Does anyone have the same experience and/or know why this would be happening? I tried to check for template changes that would work with the css file and despite being some updates (i.e. accent color), nothing stands out as the silver bullet.

 

I can see that when it's broken (attached) it starts/has the @importurl css rule, but I don't know what causes it to break. Any thoughts?

 

Best Regards,

Nuno Aguiar


Replies

 
Suzi Louring
Suzi Louring
Reply

Hi Nuno

I have experienced somerhing similar and it was caused by editing themes. 

After editing a theme, remember to click "preview", otherwise the css isn't rendered. 

I dont know if this will solve your issues, but give you can give it a try 😊

/Suzi

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Suzi,

 

Thanks. That is our workaround, but we have to do it regularly/every day because it gets broken without anybody touching it.

 

Does it keep happening for you?

 

Nuno Aguiar

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Depends how the server setup is in terms of disk.

I could imagine that 2 or more nodes are trying to write the same file to the same disk - locking the file and causing something to break.

I think something around here is the cause:

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Nicolai,

 

I don't think that's the case. Only files from node1 are copied over to the other nodes when they change; in other words, we don't share the same files across all nodes.

 

Any other thoughts?

 

Nuno Aguiar

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Complicated setups, complicated lives :-).

I have no clue - you have to trawl through eventviewe and logs etc.

Runtime Dynamicweb does not touch these files and Swift only tries to write them if they are note there of if things changed...

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

"Complicated setups, complicated lives :-)"

I hear you... and this project in particular threw us a very interesting curve ball...

 

"Runtime Dynamicweb does not touch these files and Swift only tries to write them if they are note there of if things changed..."

Perfect, that's exaclty what I was expecting to hear. We will try to find some other leads then

 

Thanks,

Nuno Aguiar

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

We just ran into the same issue on a single server without a web farm configured. I regenerated the Themes page (making a change, saving, undoing and then previewing the page) which caused a new CSS file to be written. The old one was only 13k,. the new one 63k so a lot of styles were missing. 

Did you ever figure this one out Nuno?

 
Nuno Aguiar Dynamicweb Employee
Nuno Aguiar
Reply

Hi Imar,

 

I think I did.  We found inconsistencies in the page templates and reported them to DK (below). A quick look tells me that hasn't been fixed yet.

 

What I found was that the Design pages, which are unique among themselves

 

Here's what I told them at the time:

  • The Branding, Ecommerce Badges, Font collection, Themes and CSS Decorations page templates update the css files

 

  • Notice how
    • Ecommerce Badges does not have cssFontPath as all others do (should be after cssPathTheme)
    • Font Collection does not combine the csss in the same order. Not sure if it would matter, but for consistency it should be
      • cssPathEcommerceBadges
      • cssPathTheme
      • cssPathFont
      • cssPathBranding
    • I was not thorough. Other inconsistencies may happen across all 5 page templates

 

So depending on what page you render after making changes (i.e. Ecommerce Badges), it may "break" your css.

 

Hope this solve it for you. For us, apparently got mitigated for now, but I can't say it was the silver bullet.

 

Nuno

 

You must be logged in to post in the forum